// This file is licensed under the Elastic License 2.0. Copyright 2021 StarRocks Limited.

#include <gtest/gtest.h>

#include "exprs/vectorized/decimal_cast_expr_test_helper.h"
#include "runtime/primitive_type.h"

namespace starrocks::vectorized {
PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s0ToFloatNormal) {
    CastTestCaseArray test_cases = {{9, 0, "3", -1, -1, "3.0", "false"},
                                    {9, 0, "0", -1, -1, "0.0", "false"},
                                    {9, 0, "358097699", -1, -1, "3.58097696E8", "false"},
                                    {9, 0, "-860383417", -1, -1, "-8.6038342E8", "false"},
                                    {9, 0, "954397639", -1, -1, "9.5439763E8", "false"},
                                    {9, 0, "-100123511", -1, -1, "-1.00123512E8", "false"},
                                    {9, 0, "664872254", -1, -1, "6.6487226E8", "false"},
                                    {9, 0, "13", -1, -1, "13.0", "false"},
                                    {9, 0, "-998650929", -1, -1, "-9.9865094E8", "false"},
                                    {9, 0, "386", -1, -1, "386.0", "false"},
                                    {9, 0, "92741182", -1, -1, "9.2741184E7", "false"},
                                    {9, 0, "-369300061", -1, -1, "-3.69300064E8", "false"},
                                    {9, 0, "-999997135", -1, -1, "-9.9999712E8", "false"},
                                    {9, 0, "828973478", -1, -1, "8.289735E8", "false"},
                                    {9, 0, "-314466211", -1, -1, "-3.14466208E8", "false"},
                                    {9, 0, "860579288", -1, -1, "8.6057926E8", "false"},
                                    {9, 0, "-747591886", -1, -1, "-7.4759187E8", "false"},
                                    {9, 0, "555316702", -1, -1, "5.5531667E8", "false"},
                                    {9, 0, "-999991978", -1, -1, "-9.99992E8", "false"},
                                    {9, 0, "902769296", -1, -1, "9.0276928E8", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s0ToDoubleNormal) {
    CastTestCaseArray test_cases = {{9, 0, "541843178", -1, -1, "5.41843178E8", "false"},
                                    {9, 0, "-983963136", -1, -1, "-9.83963136E8", "false"},
                                    {9, 0, "-511519477", -1, -1, "-5.11519477E8", "false"},
                                    {9, 0, "867174881", -1, -1, "8.67174881E8", "false"},
                                    {9, 0, "747726267", -1, -1, "7.47726267E8", "false"},
                                    {9, 0, "694497689", -1, -1, "6.94497689E8", "false"},
                                    {9, 0, "-999595315", -1, -1, "-9.99595315E8", "false"},
                                    {9, 0, "960658458", -1, -1, "9.60658458E8", "false"},
                                    {9, 0, "-580077573", -1, -1, "-5.80077573E8", "false"},
                                    {9, 0, "228430364", -1, -1, "2.28430364E8", "false"},
                                    {9, 0, "469460105", -1, -1, "4.69460105E8", "false"},
                                    {9, 0, "681240416", -1, -1, "6.81240416E8", "false"},
                                    {9, 0, "-999997322", -1, -1, "-9.99997322E8", "false"},
                                    {9, 0, "581918183", -1, -1, "5.81918183E8", "false"},
                                    {9, 0, "-950719188", -1, -1, "-9.50719188E8", "false"},
                                    {9, 0, "-59582414", -1, -1, "-5.9582414E7", "false"},
                                    {9, 0, "-999887224", -1, -1, "-9.99887224E8", "false"},
                                    {9, 0, "-429296877", -1, -1, "-4.29296877E8", "false"},
                                    {9, 0, "-999188898", -1, -1, "-9.99188898E8", "false"},
                                    {9, 0, "330103586", -1, -1, "3.30103586E8", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s2ToFloatNormal) {
    CastTestCaseArray test_cases = {{9, 2, "-3803961.80", -1, -1, "-3803961.8", "false"},
                                    {9, 2, "-6519310.95", -1, -1, "-6519311.0", "false"},
                                    {9, 2, "62952.50", -1, -1, "62952.5", "false"},
                                    {9, 2, "1999.58", -1, -1, "1999.58", "false"},
                                    {9, 2, "-9999980.83", -1, -1, "-9999981.0", "false"},
                                    {9, 2, "3039389.42", -1, -1, "3039389.5", "false"},
                                    {9, 2, "132.28", -1, -1, "132.28", "false"},
                                    {9, 2, "-4442215.17", -1, -1, "-4442215.0", "false"},
                                    {9, 2, "-9999980.26", -1, -1, "-9999980.0", "false"},
                                    {9, 2, "-9514849.73", -1, -1, "-9514850.0", "false"},
                                    {9, 2, "0.05", -1, -1, "0.05", "false"},
                                    {9, 2, "0.00", -1, -1, "0.0", "false"},
                                    {9, 2, "156.68", -1, -1, "156.68", "false"},
                                    {9, 2, "-9999999.93", -1, -1, "-1.0E7", "false"},
                                    {9, 2, "-2664467.55", -1, -1, "-2664467.5", "false"},
                                    {9, 2, "-2106295.72", -1, -1, "-2106295.8", "false"},
                                    {9, 2, "1818248.05", -1, -1, "1818248.0", "false"},
                                    {9, 2, "-9999999.69", -1, -1, "-1.0E7", "false"},
                                    {9, 2, "0.07", -1, -1, "0.07", "false"},
                                    {9, 2, "6949187.76", -1, -1, "6949188.0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s2ToDoubleNormal) {
    CastTestCaseArray test_cases = {{9, 2, "6532014.56", -1, -1, "6532014.56", "false"},
                                    {9, 2, "-7867361.92", -1, -1, "-7867361.92", "false"},
                                    {9, 2, "-8699110.82", -1, -1, "-8699110.82", "false"},
                                    {9, 2, "0.12", -1, -1, "0.12", "false"},
                                    {9, 2, "0.28", -1, -1, "0.28", "false"},
                                    {9, 2, "7491292.08", -1, -1, "7491292.08", "false"},
                                    {9, 2, "870194.61", -1, -1, "870194.61", "false"},
                                    {9, 2, "6874650.33", -1, -1, "6874650.33", "false"},
                                    {9, 2, "3724232.10", -1, -1, "3724232.1", "false"},
                                    {9, 2, "-7912888.64", -1, -1, "-7912888.64", "false"},
                                    {9, 2, "-9277721.51", -1, -1, "-9277721.51", "false"},
                                    {9, 2, "-3064647.71", -1, -1, "-3064647.71", "false"},
                                    {9, 2, "-6196884.78", -1, -1, "-6196884.78", "false"},
                                    {9, 2, "2458805.72", -1, -1, "2458805.72", "false"},
                                    {9, 2, "-3842789.12", -1, -1, "-3842789.12", "false"},
                                    {9, 2, "0.02", -1, -1, "0.02", "false"},
                                    {9, 2, "-7930668.10", -1, -1, "-7930668.1", "false"},
                                    {9, 2, "-4503371.50", -1, -1, "-4503371.5", "false"},
                                    {9, 2, "-8780819.53", -1, -1, "-8780819.53", "false"},
                                    {9, 2, "-5128771.15", -1, -1, "-5128771.15", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s9ToFloatNormal) {
    CastTestCaseArray test_cases = {{9, 9, "-0.828547871", -1, -1, "-0.8285479", "false"},
                                    {9, 9, "0.684917377", -1, -1, "0.6849174", "false"},
                                    {9, 9, "0.253140360", -1, -1, "0.25314036", "false"},
                                    {9, 9, "-0.995727210", -1, -1, "-0.9957272", "false"},
                                    {9, 9, "6.99E-7", -1, -1, "6.99E-7", "false"},
                                    {9, 9, "0.362000090", -1, -1, "0.36200008", "false"},
                                    {9, 9, "0.408854126", -1, -1, "0.40885413", "false"},
                                    {9, 9, "-0.999973897", -1, -1, "-0.9999739", "false"},
                                    {9, 9, "-0.394649474", -1, -1, "-0.39464948", "false"},
                                    {9, 9, "-0.839177786", -1, -1, "-0.8391778", "false"},
                                    {9, 9, "-0.247327549", -1, -1, "-0.24732755", "false"},
                                    {9, 9, "-0.281540051", -1, -1, "-0.28154004", "false"},
                                    {9, 9, "-0.999999257", -1, -1, "-0.9999993", "false"},
                                    {9, 9, "-0.011944269", -1, -1, "-0.011944269", "false"},
                                    {9, 9, "-0.999346826", -1, -1, "-0.99934685", "false"},
                                    {9, 9, "-0.573610112", -1, -1, "-0.5736101", "false"},
                                    {9, 9, "0.395188955", -1, -1, "0.39518896", "false"},
                                    {9, 9, "-0.695733378", -1, -1, "-0.69573337", "false"},
                                    {9, 9, "0.959891346", -1, -1, "0.9598913", "false"},
                                    {9, 9, "-0.998291679", -1, -1, "-0.9982917", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p9s9ToDoubleNormal) {
    CastTestCaseArray test_cases = {{9, 9, "0.553940280", -1, -1, "0.55394028", "false"},
                                    {9, 9, "-0.999011662", -1, -1, "-0.999011662", "false"},
                                    {9, 9, "0.025875691", -1, -1, "0.025875691", "false"},
                                    {9, 9, "-0.086422854", -1, -1, "-0.086422854", "false"},
                                    {9, 9, "-0.449941240", -1, -1, "-0.44994124", "false"},
                                    {9, 9, "-0.948263961", -1, -1, "-0.948263961", "false"},
                                    {9, 9, "-0.330137136", -1, -1, "-0.330137136", "false"},
                                    {9, 9, "0.845263230", -1, -1, "0.84526323", "false"},
                                    {9, 9, "0.062758442", -1, -1, "0.062758442", "false"},
                                    {9, 9, "-0.191939722", -1, -1, "-0.191939722", "false"},
                                    {9, 9, "0.137671790", -1, -1, "0.13767179", "false"},
                                    {9, 9, "-0.245615940", -1, -1, "-0.24561594", "false"},
                                    {9, 9, "-0.047507669", -1, -1, "-0.047507669", "false"},
                                    {9, 9, "-0.999999996", -1, -1, "-0.999999996", "false"},
                                    {9, 9, "0.662204035", -1, -1, "0.662204035", "false"},
                                    {9, 9, "0.000254885", -1, -1, "2.54885E-4", "false"},
                                    {9, 9, "-0.999999997", -1, -1, "-0.999999997", "false"},
                                    {9, 9, "-0.476146959", -1, -1, "-0.476146959", "false"},
                                    {9, 9, "1.4E-8", -1, -1, "1.4E-8", "false"},
                                    {9, 9, "0.786217947", -1, -1, "0.786217947", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p7s4ToFloatNormal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-259.6360", -1, -1, "-259.636", "false"},  {7, 4, "-645.1753", -1, -1, "-645.1753", "false"},
            {7, 4, "-780.9110", -1, -1, "-780.911", "false"},  {7, 4, "937.3825", -1, -1, "937.3825", "false"},
            {7, 4, "463.8318", -1, -1, "463.8318", "false"},   {7, 4, "-899.4892", -1, -1, "-899.4892", "false"},
            {7, 4, "538.0923", -1, -1, "538.0923", "false"},   {7, 4, "-104.6635", -1, -1, "-104.6635", "false"},
            {7, 4, "821.2251", -1, -1, "821.2251", "false"},   {7, 4, "-275.8660", -1, -1, "-275.866", "false"},
            {7, 4, "154.7182", -1, -1, "154.7182", "false"},   {7, 4, "-294.4132", -1, -1, "-294.4132", "false"},
            {7, 4, "-734.8605", -1, -1, "-734.8605", "false"}, {7, 4, "-191.1599", -1, -1, "-191.1599", "false"},
            {7, 4, "-822.1672", -1, -1, "-822.1672", "false"}, {7, 4, "-699.9930", -1, -1, "-699.993", "false"},
            {7, 4, "-805.4955", -1, -1, "-805.4955", "false"}, {7, 4, "505.3552", -1, -1, "505.3552", "false"},
            {7, 4, "-998.8109", -1, -1, "-998.8109", "false"}, {7, 4, "298.0771", -1, -1, "298.0771", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal32p7s4ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-745.4958", -1, -1, "-745.4958", "false"}, {7, 4, "0.0000", -1, -1, "0.0", "false"},
            {7, 4, "-954.1886", -1, -1, "-954.1886", "false"}, {7, 4, "543.5036", -1, -1, "543.5036", "false"},
            {7, 4, "-879.1311", -1, -1, "-879.1311", "false"}, {7, 4, "-86.6683", -1, -1, "-86.6683", "false"},
            {7, 4, "944.6991", -1, -1, "944.6991", "false"},   {7, 4, "-309.8653", -1, -1, "-309.8653", "false"},
            {7, 4, "-871.7205", -1, -1, "-871.7205", "false"}, {7, 4, "-83.4958", -1, -1, "-83.4958", "false"},
            {7, 4, "-7.4790", -1, -1, "-7.479", "false"},      {7, 4, "973.4449", -1, -1, "973.4449", "false"},
            {7, 4, "631.0824", -1, -1, "631.0824", "false"},   {7, 4, "15.9777", -1, -1, "15.9777", "false"},
            {7, 4, "624.2384", -1, -1, "624.2384", "false"},   {7, 4, "-570.9172", -1, -1, "-570.9172", "false"},
            {7, 4, "847.9447", -1, -1, "847.9447", "false"},   {7, 4, "259.5390", -1, -1, "259.539", "false"},
            {7, 4, "420.6152", -1, -1, "420.6152", "false"},   {7, 4, "-999.9998", -1, -1, "-999.9998", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s0ToFloatNormal) {
    CastTestCaseArray test_cases = {{18, 0, "-938166268431150884", -1, -1, "-9.3816627E17", "false"},
                                    {18, 0, "-501159214705908209", -1, -1, "-5.01159221E17", "false"},
                                    {18, 0, "-999999999999975692", -1, -1, "-9.9999998E17", "false"},
                                    {18, 0, "-556199240464938339", -1, -1, "-5.56199227E17", "false"},
                                    {18, 0, "1118713916137624", -1, -1, "1.11871389E15", "false"},
                                    {18, 0, "-805351180635063262", -1, -1, "-8.0535117E17", "false"},
                                    {18, 0, "-966982311775255119", -1, -1, "-9.6698234E17", "false"},
                                    {18, 0, "-348955728456527466", -1, -1, "-3.48955716E17", "false"},
                                    {18, 0, "-954161348499527347", -1, -1, "-9.5416134E17", "false"},
                                    {18, 0, "28756", -1, -1, "28756.0", "false"},
                                    {18, 0, "849345282991326522", -1, -1, "8.4934531E17", "false"},
                                    {18, 0, "0", -1, -1, "0.0", "false"},
                                    {18, 0, "-999999999994839356", -1, -1, "-9.9999998E17", "false"},
                                    {18, 0, "437", -1, -1, "437.0", "false"},
                                    {18, 0, "1027755205", -1, -1, "1.0277552E9", "false"},
                                    {18, 0, "-361217173514617390", -1, -1, "-3.61217161E17", "false"},
                                    {18, 0, "-999999196940214267", -1, -1, "-9.9999923E17", "false"},
                                    {18, 0, "12136329477419", -1, -1, "1.21363298E13", "false"},
                                    {18, 0, "-934279923024882915", -1, -1, "-9.3427991E17", "false"},
                                    {18, 0, "-753133979212856883", -1, -1, "-7.5313399E17", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s0ToDoubleNormal) {
    CastTestCaseArray test_cases = {{18, 0, "-541961309404654436", -1, -1, "-5.4196130940465446E17", "false"},
                                    {18, 0, "-999975978101956861", -1, -1, "-9.9997597810195686E17", "false"},
                                    {18, 0, "-999999999999948863", -1, -1, "-9.999999999999488E17", "false"},
                                    {18, 0, "-983087066890677920", -1, -1, "-9.8308706689067789E17", "false"},
                                    {18, 0, "4162566336", -1, -1, "4.162566336E9", "false"},
                                    {18, 0, "959292664657500738", -1, -1, "9.592926646575008E17", "false"},
                                    {18, 0, "-625932414399151432", -1, -1, "-6.2593241439915149E17", "false"},
                                    {18, 0, "42713689422531598", -1, -1, "4.27136894225316E16", "false"},
                                    {18, 0, "-227470490613604520", -1, -1, "-2.27470490613604512E17", "false"},
                                    {18, 0, "36142359785897310", -1, -1, "3.6142359785897312E16", "false"},
                                    {18, 0, "368653702854761950", -1, -1, "3.6865370285476192E17", "false"},
                                    {18, 0, "28", -1, -1, "28.0", "false"},
                                    {18, 0, "-656527140943230748", -1, -1, "-6.5652714094323072E17", "false"},
                                    {18, 0, "-999999999991938408", -1, -1, "-9.9999999999193843E17", "false"},
                                    {18, 0, "692578546311779351", -1, -1, "6.9257854631177933E17", "false"},
                                    {18, 0, "471157030029456511", -1, -1, "4.7115703002945651E17", "false"},
                                    {18, 0, "77603913864757373", -1, -1, "7.7603913864757376E16", "false"},
                                    {18, 0, "266828629718667883", -1, -1, "2.66828629718667872E17", "false"},
                                    {18, 0, "-866619587089878549", -1, -1, "-8.6661958708987853E17", "false"},
                                    {18, 0, "514487306101988841", -1, -1, "5.1448730610198886E17", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s2ToFloatNormal) {
    CastTestCaseArray test_cases = {{18, 2, "6632924438545506.33", -1, -1, "6.6329247E15", "false"},
                                    {18, 2, "1734249.59", -1, -1, "1734249.6", "false"},
                                    {18, 2, "1550930565098415.02", -1, -1, "1.55093054E15", "false"},
                                    {18, 2, "-1749874318831706.66", -1, -1, "-1.74987437E15", "false"},
                                    {18, 2, "769765.39", -1, -1, "769765.4", "false"},
                                    {18, 2, "6825187644071303.53", -1, -1, "6.8251878E15", "false"},
                                    {18, 2, "1646379643521989.44", -1, -1, "1.64637961E15", "false"},
                                    {18, 2, "9708502256368230.93", -1, -1, "9.7085019E15", "false"},
                                    {18, 2, "-9999998708986721.31", -1, -1, "-9.9999992E15", "false"},
                                    {18, 2, "4885.87", -1, -1, "4885.87", "false"},
                                    {18, 2, "-9999999999999999.02", -1, -1, "-1.00000003E16", "false"},
                                    {18, 2, "-9999999999999994.95", -1, -1, "-1.00000003E16", "false"},
                                    {18, 2, "14.44", -1, -1, "14.44", "false"},
                                    {18, 2, "19126724387881.18", -1, -1, "1.91267246E13", "false"},
                                    {18, 2, "-9999999999999860.67", -1, -1, "-1.00000003E16", "false"},
                                    {18, 2, "29694329632.16", -1, -1, "2.96943288E10", "false"},
                                    {18, 2, "3336992230750641.61", -1, -1, "3.33699229E15", "false"},
                                    {18, 2, "-9999990876429172.72", -1, -1, "-9.9999906E15", "false"},
                                    {18, 2, "4842879.04", -1, -1, "4842879.0", "false"},
                                    {18, 2, "977268890047865.58", -1, -1, "9.7726887E14", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s2ToDoubleNormal) {
    CastTestCaseArray test_cases = {{18, 2, "-4095522079114126.14", -1, -1, "-4.095522079114126E15", "false"},
                                    {18, 2, "5736390242745053.46", -1, -1, "5.736390242745053E15", "false"},
                                    {18, 2, "8896277666335595.11", -1, -1, "8.896277666335595E15", "false"},
                                    {18, 2, "265090002273246.05", -1, -1, "2.6509000227324606E14", "false"},
                                    {18, 2, "-634221145866810.89", -1, -1, "-6.342211458668109E14", "false"},
                                    {18, 2, "-1431660252179763.06", -1, -1, "-1.431660252179763E15", "false"},
                                    {18, 2, "4244072927686207.36", -1, -1, "4.2440729276862075E15", "false"},
                                    {18, 2, "0.90", -1, -1, "0.9", "false"},
                                    {18, 2, "-8386284725438882.72", -1, -1, "-8.386284725438883E15", "false"},
                                    {18, 2, "3053766927478299.29", -1, -1, "3.0537669274782995E15", "false"},
                                    {18, 2, "-9999970170845803.82", -1, -1, "-9.999970170845804E15", "false"},
                                    {18, 2, "-9230848076690550.22", -1, -1, "-9.23084807669055E15", "false"},
                                    {18, 2, "-9999322105974502.82", -1, -1, "-9.999322105974502E15", "false"},
                                    {18, 2, "9387818113375319.26", -1, -1, "9.38781811337532E15", "false"},
                                    {18, 2, "-1542773874874242.94", -1, -1, "-1.542773874874243E15", "false"},
                                    {18, 2, "-7649443552128702.00", -1, -1, "-7.649443552128702E15", "false"},
                                    {18, 2, "-9008382265455840.95", -1, -1, "-9.00838226545584E15", "false"},
                                    {18, 2, "-9999999999999999.69", -1, -1, "-1.0E16", "false"},
                                    {18, 2, "6158150441790.35", -1, -1, "6.15815044179035E12", "false"},
                                    {18, 2, "-9999999999999999.93", -1, -1, "-1.0E16", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s9ToFloatNormal) {
    CastTestCaseArray test_cases = {{18, 9, "-999999999.999999985", -1, -1, "-1.0E9", "false"},
                                    {18, 9, "0.012571952", -1, -1, "0.012571952", "false"},
                                    {18, 9, "740443013.514110386", -1, -1, "7.4044301E8", "false"},
                                    {18, 9, "-429042499.196602164", -1, -1, "-4.29042496E8", "false"},
                                    {18, 9, "0.000001012", -1, -1, "1.012E-6", "false"},
                                    {18, 9, "-999999685.052945006", -1, -1, "-9.9999968E8", "false"},
                                    {18, 9, "-999999999.997875410", -1, -1, "-1.0E9", "false"},
                                    {18, 9, "844497394.511392627", -1, -1, "8.4449741E8", "false"},
                                    {18, 9, "-999999999.999773392", -1, -1, "-1.0E9", "false"},
                                    {18, 9, "0.000019302", -1, -1, "1.9302E-5", "false"},
                                    {18, 9, "-612688915.663849248", -1, -1, "-6.126889E8", "false"},
                                    {18, 9, "6514423.642808947", -1, -1, "6514423.5", "false"},
                                    {18, 9, "327741723.511312159", -1, -1, "3.27741728E8", "false"},
                                    {18, 9, "-726904379.616680101", -1, -1, "-7.2690438E8", "false"},
                                    {18, 9, "0.000224553", -1, -1, "2.24553E-4", "false"},
                                    {18, 9, "3.25E-7", -1, -1, "3.25E-7", "false"},
                                    {18, 9, "320065854.071567420", -1, -1, "3.20065856E8", "false"},
                                    {18, 9, "-204486644.302537512", -1, -1, "-2.0448664E8", "false"},
                                    {18, 9, "-999999999.897209760", -1, -1, "-1.0E9", "false"},
                                    {18, 9, "566361425.339049648", -1, -1, "5.6636141E8", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s9ToDoubleNormal) {
    CastTestCaseArray test_cases = {{18, 9, "333952444.020626525", -1, -1, "3.3395244402062654E8", "false"},
                                    {18, 9, "394588113.266236360", -1, -1, "3.9458811326623636E8", "false"},
                                    {18, 9, "-417948591.779190677", -1, -1, "-4.1794859177919066E8", "false"},
                                    {18, 9, "949795962.200325571", -1, -1, "9.497959622003256E8", "false"},
                                    {18, 9, "572017508.565642822", -1, -1, "5.720175085656428E8", "false"},
                                    {18, 9, "-999999999.769193340", -1, -1, "-9.999999997691933E8", "false"},
                                    {18, 9, "455784369.306251788", -1, -1, "4.5578436930625176E8", "false"},
                                    {18, 9, "-293821782.578590274", -1, -1, "-2.938217825785903E8", "false"},
                                    {18, 9, "508122261.614921766", -1, -1, "5.0812226161492175E8", "false"},
                                    {18, 9, "-999999999.999998658", -1, -1, "-9.999999999999987E8", "false"},
                                    {18, 9, "843976944.259889455", -1, -1, "8.439769442598895E8", "false"},
                                    {18, 9, "773666523.460473964", -1, -1, "7.73666523460474E8", "false"},
                                    {18, 9, "-81366346.515031663", -1, -1, "-8.136634651503167E7", "false"},
                                    {18, 9, "383855733.806735195", -1, -1, "3.838557338067352E8", "false"},
                                    {18, 9, "-805037833.436848840", -1, -1, "-8.050378334368489E8", "false"},
                                    {18, 9, "-999999999.999999996", -1, -1, "-1.0E9", "false"},
                                    {18, 9, "-344462721.756674225", -1, -1, "-3.4446272175667423E8", "false"},
                                    {18, 9, "6.33E-7", -1, -1, "6.33E-7", "false"},
                                    {18, 9, "416693.816711601", -1, -1, "416693.816711601", "false"},
                                    {18, 9, "571661100.353718308", -1, -1, "5.716611003537183E8", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s18ToFloatNormal) {
    CastTestCaseArray test_cases = {{18, 18, "0.175839349324979276", -1, -1, "0.17583935", "false"},
                                    {18, 18, "0.572732472519662796", -1, -1, "0.57273245", "false"},
                                    {18, 18, "-0.999999999670177449", -1, -1, "-1.0", "false"},
                                    {18, 18, "-0.907379635972963725", -1, -1, "-0.9073796", "false"},
                                    {18, 18, "-0.075371092004752672", -1, -1, "-0.075371094", "false"},
                                    {18, 18, "-0.973548851611954462", -1, -1, "-0.9735488", "false"},
                                    {18, 18, "0.716777910120978292", -1, -1, "0.7167779", "false"},
                                    {18, 18, "-0.248419716124586840", -1, -1, "-0.24841972", "false"},
                                    {18, 18, "1.796E-15", -1, -1, "1.796E-15", "false"},
                                    {18, 18, "-0.180255630196399786", -1, -1, "-0.18025564", "false"},
                                    {18, 18, "4.1598808E-11", -1, -1, "4.1598808E-11", "false"},
                                    {18, 18, "2.4967E-14", -1, -1, "2.4967E-14", "false"},
                                    {18, 18, "-0.795116105191512959", -1, -1, "-0.7951161", "false"},
                                    {18, 18, "-0.727959365391953855", -1, -1, "-0.7279594", "false"},
                                    {18, 18, "9.9E-17", -1, -1, "9.9E-17", "false"},
                                    {18, 18, "2.681423E-12", -1, -1, "2.681423E-12", "false"},
                                    {18, 18, "4.264599635E-9", -1, -1, "4.2646E-9", "false"},
                                    {18, 18, "-0.332906867937403952", -1, -1, "-0.33290687", "false"},
                                    {18, 18, "0.374379495419925356", -1, -1, "0.3743795", "false"},
                                    {18, 18, "-0.728371770958581793", -1, -1, "-0.7283718", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p18s18ToDoubleNormal) {
    CastTestCaseArray test_cases = {{18, 18, "0.840805956512093937", -1, -1, "0.8408059565120939", "false"},
                                    {18, 18, "-0.526529803106626529", -1, -1, "-0.5265298031066266", "false"},
                                    {18, 18, "0.336733765285760203", -1, -1, "0.3367337652857602", "false"},
                                    {18, 18, "-0.999999999991819521", -1, -1, "-0.9999999999918195", "false"},
                                    {18, 18, "1.770404742E-9", -1, -1, "1.770404742E-9", "false"},
                                    {18, 18, "5.3826475E-11", -1, -1, "5.3826475E-11", "false"},
                                    {18, 18, "5.580809E-12", -1, -1, "5.580809E-12", "false"},
                                    {18, 18, "0.007078539347058591", -1, -1, "0.007078539347058591", "false"},
                                    {18, 18, "0.675422120692584129", -1, -1, "0.6754221206925841", "false"},
                                    {18, 18, "-0.999999999999999996", -1, -1, "-1.0", "false"},
                                    {18, 18, "-0.999995711762869318", -1, -1, "-0.9999957117628693", "false"},
                                    {18, 18, "-0.474851211364890195", -1, -1, "-0.47485121136489017", "false"},
                                    {18, 18, "-0.699417790104424605", -1, -1, "-0.6994177901044246", "false"},
                                    {18, 18, "0.228526485067038004", -1, -1, "0.22852648506703802", "false"},
                                    {18, 18, "0.844142783631125402", -1, -1, "0.8441427836311254", "false"},
                                    {18, 18, "0.208073178733605770", -1, -1, "0.20807317873360576", "false"},
                                    {18, 18, "-0.269941850412931165", -1, -1, "-0.2699418504129312", "false"},
                                    {18, 18, "-0.564363446149668686", -1, -1, "-0.5643634461496687", "false"},
                                    {18, 18, "-0.999999999999999963", -1, -1, "-1.0", "false"},
                                    {18, 18, "-0.999933226262610906", -1, -1, "-0.9999332262626109", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p15s13ToFloatNormal) {
    CastTestCaseArray test_cases = {{15, 13, "0.0002081934777", -1, -1, "2.0819348E-4", "false"},
                                    {15, 13, "2.533116E-7", -1, -1, "2.533116E-7", "false"},
                                    {15, 13, "40.6804122439142", -1, -1, "40.680412", "false"},
                                    {15, 13, "45.0833655838595", -1, -1, "45.083366", "false"},
                                    {15, 13, "65.8997788758134", -1, -1, "65.89978", "false"},
                                    {15, 13, "-22.1655940009203", -1, -1, "-22.165594", "false"},
                                    {15, 13, "98.5312169690818", -1, -1, "98.53122", "false"},
                                    {15, 13, "-57.3798054272885", -1, -1, "-57.379807", "false"},
                                    {15, 13, "-99.9991524778742", -1, -1, "-99.99915", "false"},
                                    {15, 13, "0.0000055616264", -1, -1, "5.5616265E-6", "false"},
                                    {15, 13, "10.8003510615977", -1, -1, "10.800351", "false"},
                                    {15, 13, "-47.2664628990761", -1, -1, "-47.266464", "false"},
                                    {15, 13, "56.2657176905106", -1, -1, "56.265717", "false"},
                                    {15, 13, "-30.1895327812636", -1, -1, "-30.189533", "false"},
                                    {15, 13, "-72.9803706930219", -1, -1, "-72.98037", "false"},
                                    {15, 13, "5.38E-11", -1, -1, "5.38E-11", "false"},
                                    {15, 13, "58.3742975097163", -1, -1, "58.3743", "false"},
                                    {15, 13, "-49.0266103420430", -1, -1, "-49.02661", "false"},
                                    {15, 13, "48.3159351849823", -1, -1, "48.315937", "false"},
                                    {15, 13, "40.4555582488629", -1, -1, "40.45556", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal64p15s13ToDoubleNormal) {
    CastTestCaseArray test_cases = {{15, 13, "-34.4452221950118", -1, -1, "-34.4452221950118", "false"},
                                    {15, 13, "-75.4097981405169", -1, -1, "-75.4097981405169", "false"},
                                    {15, 13, "-98.9502166658088", -1, -1, "-98.9502166658088", "false"},
                                    {15, 13, "0.0000963567201", -1, -1, "9.63567201E-5", "false"},
                                    {15, 13, "11.2073093546519", -1, -1, "11.2073093546519", "false"},
                                    {15, 13, "27.8060067079717", -1, -1, "27.8060067079717", "false"},
                                    {15, 13, "-40.1820108998416", -1, -1, "-40.1820108998416", "false"},
                                    {15, 13, "4.65465E-8", -1, -1, "4.65465E-8", "false"},
                                    {15, 13, "-24.5630911868358", -1, -1, "-24.5630911868358", "false"},
                                    {15, 13, "52.9552794323962", -1, -1, "52.9552794323962", "false"},
                                    {15, 13, "14.0086851398376", -1, -1, "14.0086851398376", "false"},
                                    {15, 13, "-23.5814714021401", -1, -1, "-23.5814714021401", "false"},
                                    {15, 13, "89.6384884612819", -1, -1, "89.6384884612819", "false"},
                                    {15, 13, "-80.9413958869426", -1, -1, "-80.9413958869426", "false"},
                                    {15, 13, "-73.7291129232264", -1, -1, "-73.7291129232264", "false"},
                                    {15, 13, "79.8853940855108", -1, -1, "79.8853940855108", "false"},
                                    {15, 13, "36.0840766878778", -1, -1, "36.0840766878778", "false"},
                                    {15, 13, "0.0003996995755", -1, -1, "3.996995755E-4", "false"},
                                    {15, 13, "50.3757344762754", -1, -1, "50.3757344762754", "false"},
                                    {15, 13, "-99.7153693915174", -1, -1, "-99.7153693915174", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s0ToFloatNormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99999999999999999970838299484947639763", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "-99999999999999999999997392681933914840", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "14049902559730600407052810966794344", -1, -1, "1.4049903E34", "false"},
                                    {38, 0, "-99999999999892024591978865150384755912", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "-99999999999999999981773255651687861688", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "120747695049233951591110616598", -1, -1, "1.207477E29", "false"},
                                    {38, 0, "218974143882903058248557414480372", -1, -1, "2.1897415E32", "false"},
                                    {38, 0, "6182", -1, -1, "6182.0", "false"},
                                    {38, 0, "-99998548372236134798848299096654491548", -1, -1, "-9.999855E37", "false"},
                                    {38, 0, "-99999999999999967849616695071542853065", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "-99999999999999999999999999987370690537", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "-99998910913046442592898795049731602445", -1, -1, "-9.999891E37", "false"},
                                    {38, 0, "6775613058080445", -1, -1, "6.7756132E15", "false"},
                                    {38, 0, "558806697932423", -1, -1, "5.58806686E14", "false"},
                                    {38, 0, "2168", -1, -1, "2168.0", "false"},
                                    {38, 0, "-99999999999999999999999999999983773828", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "-99999032887712417704281786333024926103", -1, -1, "-9.999903E37", "false"},
                                    {38, 0, "-47768650516588850991600185488755912480", -1, -1, "-4.776865E37", "false"},
                                    {38, 0, "-99999999999999999554226383075581416471", -1, -1, "-1.0E38", "false"},
                                    {38, 0, "260", -1, -1, "260.0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s0ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {38, 0, "72409012665649", -1, -1, "7.2409012665649E13", "false"},
            {38, 0, "-99999999916277638996201245655631220711", -1, -1, "-9.999999991627763E37", "false"},
            {38, 0, "78927733175824478796204765075", -1, -1, "7.892773317582448E28", "false"},
            {38, 0, "-99999999999943654470916571870161424164", -1, -1, "-9.999999999994365E37", "false"},
            {38, 0, "6884560799172385507683871", -1, -1, "6.884560799172385E24", "false"},
            {38, 0, "-99999999999999999999999975453275779714", -1, -1, "-1.0E38", "false"},
            {38, 0, "-99999999999997553580502158708047724817", -1, -1, "-9.999999999999756E37", "false"},
            {38, 0, "2080434018100879698295071769", -1, -1, "2.0804340181008796E27", "false"},
            {38, 0, "-99999999999999999999999999999998700165", -1, -1, "-1.0E38", "false"},
            {38, 0, "-99999999999999999999999999999655921341", -1, -1, "-1.0E38", "false"},
            {38, 0, "406070131886271", -1, -1, "4.06070131886271E14", "false"},
            {38, 0, "196271335816", -1, -1, "1.96271335816E11", "false"},
            {38, 0, "8339244", -1, -1, "8339244.0", "false"},
            {38, 0, "-99999999999999999999999993662072813814", -1, -1, "-1.0E38", "false"},
            {38, 0, "159512161475129993524758258321131", -1, -1, "1.5951216147513E32", "false"},
            {38, 0, "52", -1, -1, "52.0", "false"},
            {38, 0, "-99999999999999999999999999999999997700", -1, -1, "-1.0E38", "false"},
            {38, 0, "-99999999999999999999996816312407227129", -1, -1, "-1.0E38", "false"},
            {38, 0, "-99999999927163856274332352234915607151", -1, -1, "-9.999999992716386E37", "false"},
            {38, 0, "3224224713630455", -1, -1, "3.224224713630455E15", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s2ToFloatNormal) {
    CastTestCaseArray test_cases = {
            {38, 2, "175953971703780187806708379.15", -1, -1, "1.7595397E26", "false"},
            {38, 2, "-999999999999999953919004359620362178.08", -1, -1, "-1.0E36", "false"},
            {38, 2, "76429781257512081914596165497198.88", -1, -1, "7.642978E31", "false"},
            {38, 2, "-999999999999999999999999999999996062.51", -1, -1, "-1.0E36", "false"},
            {38, 2, "12507.06", -1, -1, "12507.06", "false"},
            {38, 2, "0.02", -1, -1, "0.02", "false"},
            {38, 2, "88240918235702966.89", -1, -1, "8.8240919E16", "false"},
            {38, 2, "69263.28", -1, -1, "69263.28", "false"},
            {38, 2, "-999999999999999999999999999999999355.27", -1, -1, "-1.0E36", "false"},
            {38, 2, "21093.17", -1, -1, "21093.17", "false"},
            {38, 2, "1049348450607097017630.88", -1, -1, "1.0493484E21", "false"},
            {38, 2, "-999987104011773023254074311888890580.53", -1, -1, "-9.999871E35", "false"},
            {38, 2, "-999999999999999995867695848394326633.63", -1, -1, "-1.0E36", "false"},
            {38, 2, "78578.35", -1, -1, "78578.35", "false"},
            {38, 2, "-999999999999999651736751226871682371.77", -1, -1, "-1.0E36", "false"},
            {38, 2, "-999999999999999999999999984248545176.10", -1, -1, "-1.0E36", "false"},
            {38, 2, "596990102996298640411185827.30", -1, -1, "5.969901E26", "false"},
            {38, 2, "1605165323017811568591202.94", -1, -1, "1.6051653E24", "false"},
            {38, 2, "25902485033216125857.03", -1, -1, "2.5902484E19", "false"},
            {38, 2, "0.30", -1, -1, "0.3", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s2ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {38, 2, "994176711505900922382310.80", -1, -1, "9.94176711505901E23", "false"},
            {38, 2, "3569984760477377965130641142683.00", -1, -1, "3.569984760477378E30", "false"},
            {38, 2, "-999999999992087680039320050718103312.74", -1, -1, "-9.999999999920877E35", "false"},
            {38, 2, "-947821930397342143244579130207606003.54", -1, -1, "-9.478219303973421E35", "false"},
            {38, 2, "76981814209924201401491408154985557.94", -1, -1, "7.698181420992421E34", "false"},
            {38, 2, "3978784013440413222057479.49", -1, -1, "3.9787840134404134E24", "false"},
            {38, 2, "122080084408499675509.93", -1, -1, "1.2208008440849968E20", "false"},
            {38, 2, "-999999682311409981220154094075528771.86", -1, -1, "-9.9999968231141E35", "false"},
            {38, 2, "-999999851527631308153106706395424131.43", -1, -1, "-9.999998515276312E35", "false"},
            {38, 2, "-999999999999999999994311002569947213.38", -1, -1, "-1.0E36", "false"},
            {38, 2, "17213347.37", -1, -1, "1.721334737E7", "false"},
            {38, 2, "-999999999999999999999999999999991880.82", -1, -1, "-1.0E36", "false"},
            {38, 2, "-806051449409834286636959449398116727.17", -1, -1, "-8.060514494098343E35", "false"},
            {38, 2, "1131888.40", -1, -1, "1131888.4", "false"},
            {38, 2, "3397328486254679258109141616009.59", -1, -1, "3.397328486254679E30", "false"},
            {38, 2, "-999999999999999999999999999452242731.76", -1, -1, "-1.0E36", "false"},
            {38, 2, "56838766190443921.71", -1, -1, "5.683876619044392E16", "false"},
            {38, 2, "-999999999998798505717509007424355382.72", -1, -1, "-9.999999999987985E35", "false"},
            {38, 2, "-999999999999999999999999660475996566.28", -1, -1, "-1.0E36", "false"},
            {38, 2, "102175696064581882272.29", -1, -1, "1.0217569606458188E20", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s9ToFloatNormal) {
    CastTestCaseArray test_cases = {
            {38, 9, "90138082921576419701836.476369633", -1, -1, "9.013809E22", "false"},
            {38, 9, "-99999179362490614926223728184.986746051", -1, -1, "-9.999918E28", "false"},
            {38, 9, "0.000440048", -1, -1, "4.40048E-4", "false"},
            {38, 9, "-99999999999999999605659367827.030855840", -1, -1, "-1.0E29", "false"},
            {38, 9, "-99999999999999999991746052357.045863072", -1, -1, "-1.0E29", "false"},
            {38, 9, "-99999999996603507794555268214.924536801", -1, -1, "-1.0E29", "false"},
            {38, 9, "-99999999999999999534643319739.555189038", -1, -1, "-1.0E29", "false"},
            {38, 9, "-99924504336861265938108445583.117147966", -1, -1, "-9.99245E28", "false"},
            {38, 9, "0.000004511", -1, -1, "4.511E-6", "false"},
            {38, 9, "-99999999968863452558206027336.222463818", -1, -1, "-1.0E29", "false"},
            {38, 9, "14379616007.804585220", -1, -1, "1.43796163E10", "false"},
            {38, 9, "-99999999999999999999999821434.318648658", -1, -1, "-1.0E29", "false"},
            {38, 9, "0.000327514", -1, -1, "3.27514E-4", "false"},
            {38, 9, "891224.259934760", -1, -1, "891224.25", "false"},
            {38, 9, "5.2E-8", -1, -1, "5.2E-8", "false"},
            {38, 9, "1798395.793247509", -1, -1, "1798395.8", "false"},
            {38, 9, "0.000008191", -1, -1, "8.191E-6", "false"},
            {38, 9, "781919884002042.235146245", -1, -1, "7.8191987E14", "false"},
            {38, 9, "-99999999999999999999999999999.999949930", -1, -1, "-1.0E29", "false"},
            {38, 9, "344919722.034870111", -1, -1, "3.44919712E8", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s9ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {38, 9, "-99916962632475233516138432784.279811323", -1, -1, "-9.991696263247523E28", "false"},
            {38, 9, "35131570474640.158575104", -1, -1, "3.513157047464016E13", "false"},
            {38, 9, "102326787496.506373295", -1, -1, "1.0232678749650638E11", "false"},
            {38, 9, "2.0E-8", -1, -1, "2.0E-8", "false"},
            {38, 9, "1323593.427314950", -1, -1, "1323593.42731495", "false"},
            {38, 9, "154438902986091661.751846171", -1, -1, "1.54438902986091648E17", "false"},
            {38, 9, "-99999999999999999999999999999.999855894", -1, -1, "-1.0E29", "false"},
            {38, 9, "-99999999999999999999974636100.286373473", -1, -1, "-1.0E29", "false"},
            {38, 9, "6.9E-8", -1, -1, "6.9E-8", "false"},
            {38, 9, "-99999999999999999546455970136.815181102", -1, -1, "-1.0E29", "false"},
            {38, 9, "934113.015022273", -1, -1, "934113.015022273", "false"},
            {38, 9, "-99999999999999993346194878907.292748164", -1, -1, "-1.0E29", "false"},
            {38, 9, "726.052568611", -1, -1, "726.052568611", "false"},
            {38, 9, "-99999999999999999999999929721.039531130", -1, -1, "-1.0E29", "false"},
            {38, 9, "0.187741301", -1, -1, "0.187741301", "false"},
            {38, 9, "-99999999999992771556849730519.903822887", -1, -1, "-9.999999999999278E28", "false"},
            {38, 9, "-99999999999999317798608778048.660744901", -1, -1, "-9.999999999999932E28", "false"},
            {38, 9, "-99999999999999999999999999999.999999951", -1, -1, "-1.0E29", "false"},
            {38, 9, "770435373.232038928", -1, -1, "7.70435373232039E8", "false"},
            {38, 9, "-99999999999999999999944022401.910353011", -1, -1, "-1.0E29", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s13ToFloatNormal) {
    CastTestCaseArray test_cases = {
            {38, 13, "172292058229178092047333.2305871702002", -1, -1, "1.7229207E23", "false"},
            {38, 13, "2.4965E-9", -1, -1, "2.4965E-9", "false"},
            {38, 13, "7.83682E-8", -1, -1, "7.83682E-8", "false"},
            {38, 13, "3.654481E-7", -1, -1, "3.654481E-7", "false"},
            {38, 13, "1.38683E-8", -1, -1, "1.38683E-8", "false"},
            {38, 13, "-9999999999999999999999999.9999999761783", -1, -1, "-1.0E25", "false"},
            {38, 13, "1.56942E-8", -1, -1, "1.56942E-8", "false"},
            {38, 13, "148785.6196484401446", -1, -1, "148785.62", "false"},
            {38, 13, "-9999999999999999999999999.9999999999584", -1, -1, "-1.0E25", "false"},
            {38, 13, "-9999999999999997839105733.9467239009671", -1, -1, "-1.0E25", "false"},
            {38, 13, "40718725159061284236.9174324352340", -1, -1, "4.0718724E19", "false"},
            {38, 13, "-9999999988965153331027466.2705658540739", -1, -1, "-1.0E25", "false"},
            {38, 13, "-9999999999999999999999999.9999985621329", -1, -1, "-1.0E25", "false"},
            {38, 13, "-9978368532440240966662656.8891577890261", -1, -1, "-9.978368E24", "false"},
            {38, 13, "18.6754008520519", -1, -1, "18.675402", "false"},
            {38, 13, "6E-13", -1, -1, "6.0E-13", "false"},
            {38, 13, "4109.7291940547694", -1, -1, "4109.729", "false"},
            {38, 13, "7043671511416544.2029339068497", -1, -1, "7.0436717E15", "false"},
            {38, 13, "254299091738827306591.8970776653272", -1, -1, "2.542991E20", "false"},
            {38, 13, "0.3628876615392", -1, -1, "0.36288765", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s13ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {38, 13, "3.7787378408593", -1, -1, "3.7787378408593", "false"},
            {38, 13, "-9999999999999987571504367.1814665472163", -1, -1, "-9.999999999999988E24", "false"},
            {38, 13, "-9999999999999999931769053.1362480893181", -1, -1, "-1.0E25", "false"},
            {38, 13, "-9739512250408834349865350.1337301727322", -1, -1, "-9.739512250408834E24", "false"},
            {38, 13, "-9999999999999999999999999.9999997682321", -1, -1, "-1.0E25", "false"},
            {38, 13, "19827800434217164954323.2843325174939", -1, -1, "1.9827800434217163E22", "false"},
            {38, 13, "-9999999999999999999999999.9993606588878", -1, -1, "-1.0E25", "false"},
            {38, 13, "0.0000027143491", -1, -1, "2.7143491E-6", "false"},
            {38, 13, "212.5421709588012", -1, -1, "212.5421709588012", "false"},
            {38, 13, "-9999999999999999999949082.8424974235633", -1, -1, "-1.0E25", "false"},
            {38, 13, "-9999999999992597919302317.6078824193765", -1, -1, "-9.999999999992599E24", "false"},
            {38, 13, "-9999999992368050997175787.5710240817021", -1, -1, "-9.99999999236805E24", "false"},
            {38, 13, "908571884474733.1604142902702", -1, -1, "9.085718844747331E14", "false"},
            {38, 13, "-9999999999999999999999999.9999999999997", -1, -1, "-1.0E25", "false"},
            {38, 13, "-7934787363464386809286569.5535166252997", -1, -1, "-7.934787363464386E24", "false"},
            {38, 13, "-9999998102956415344205286.3125406973175", -1, -1, "-9.999998102956416E24", "false"},
            {38, 13, "26756260000805.0446883425827", -1, -1, "2.6756260000805043E13", "false"},
            {38, 13, "0.0090749499055", -1, -1, "0.0090749499055", "false"},
            {38, 13, "99.6424491300305", -1, -1, "99.6424491300305", "false"},
            {38, 13, "487797560906599033053.9849338978132", -1, -1, "4.8779756090659904E20", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s18ToFloatNormal) {
    CastTestCaseArray test_cases = {
            {38, 18, "-99999996119370915982.347668509993681939", -1, -1, "-9.999999E19", "false"},
            {38, 18, "-99999989366035637650.357494639286853076", -1, -1, "-9.999999E19", "false"},
            {38, 18, "-99999999999999999999.999999999963238364", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999999999865.926234246662361718", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999706361707.847994444514711658", -1, -1, "-1.0E20", "false"},
            {38, 18, "3738758.430329605247351763", -1, -1, "3738758.5", "false"},
            {38, 18, "-99999999999881816019.217109777001167159", -1, -1, "-1.0E20", "false"},
            {38, 18, "0.000001637553506184", -1, -1, "1.6375535E-6", "false"},
            {38, 18, "-99999999999745542834.673557336443799007", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999987033114078.783303519640030903", -1, -1, "-1.0E20", "false"},
            {38, 18, "8.07E-16", -1, -1, "8.07E-16", "false"},
            {38, 18, "475412442244.324119922427447772", -1, -1, "4.75412431E11", "false"},
            {38, 18, "2.4336E-14", -1, -1, "2.4336E-14", "false"},
            {38, 18, "6.893E-15", -1, -1, "6.893E-15", "false"},
            {38, 18, "39534143394430444.466291219045428319", -1, -1, "3.9534143E16", "false"},
            {38, 18, "-99999999999999999999.999999842942636391", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999999570450.420366341877095459", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999999999999.990064782644931141", -1, -1, "-1.0E20", "false"},
            {38, 18, "1.719E-15", -1, -1, "1.719E-15", "false"},
            {38, 18, "-99999999999999999998.696598477688516832", -1, -1, "-1.0E20", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p38s18ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {38, 18, "1.2753E-14", -1, -1, "1.2753E-14", "false"},
            {38, 18, "-99999999999999999999.999999999999992185", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999999999999.957235435957083481", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999942740659.042124282130856534", -1, -1, "-9.999999999994274E19", "false"},
            {38, 18, "-99999999999999994238.435684968912899841", -1, -1, "-1.0E20", "false"},
            {38, 18, "9.2E-17", -1, -1, "9.2E-17", "false"},
            {38, 18, "-99999999999999965159.582708402487106640", -1, -1, "-9.999999999999997E19", "false"},
            {38, 18, "142754871296540616.087882232413860993", -1, -1, "1.42754871296540624E17", "false"},
            {38, 18, "2.7547E-14", -1, -1, "2.7547E-14", "false"},
            {38, 18, "-99999996851209909706.553334265324725979", -1, -1, "-9.999999685120991E19", "false"},
            {38, 18, "-99999999999999999999.999941400112680766", -1, -1, "-1.0E20", "false"},
            {38, 18, "-99999999999998885693.185042992755413958", -1, -1, "-9.999999999999889E19", "false"},
            {38, 18, "-99999999999999995035.583931354014494322", -1, -1, "-1.0E20", "false"},
            {38, 18, "405513895160269.854542920420760578", -1, -1, "4.055138951602699E14", "false"},
            {38, 18, "1526.424263747669092856", -1, -1, "1526.424263747669", "false"},
            {38, 18, "-99999999999999999812.348148366897158130", -1, -1, "-1.0E20", "false"},
            {38, 18, "0.000495299100971721", -1, -1, "4.95299100971721E-4", "false"},
            {38, 18, "542122.278666081397616211", -1, -1, "542122.2786660814", "false"},
            {38, 18, "-99999847692782893995.139633542916094497", -1, -1, "-9.99998476927829E19", "false"},
            {38, 18, "-99999999999792734118.124466854395464903", -1, -1, "-9.999999999979273E19", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p35s30ToFloatNormal) {
    CastTestCaseArray test_cases = {{35, 30, "7.861710097836E-18", -1, -1, "7.86171E-18", "false"},
                                    {35, 30, "-99999.999999999999999650802717002580", -1, -1, "-100000.0", "false"},
                                    {35, 30, "4.686496810842891895928674240664", -1, -1, "4.6864967", "false"},
                                    {35, 30, "-99999.999999999999999999999826450636", -1, -1, "-100000.0", "false"},
                                    {35, 30, "-99999.999999999999999999999999999955", -1, -1, "-100000.0", "false"},
                                    {35, 30, "-99992.646754957520114716220001858964", -1, -1, "-99992.65", "false"},
                                    {35, 30, "2672.456624974174622130567057669150", -1, -1, "2672.4565", "false"},
                                    {35, 30, "1.790604690E-21", -1, -1, "1.7906047E-21", "false"},
                                    {35, 30, "-99999.998337123870544817198909995965", -1, -1, "-100000.0", "false"},
                                    {35, 30, "0.000023134146628564095891318003", -1, -1, "2.3134147E-5", "false"},
                                    {35, 30, "-99999.774112313826222997385398609825", -1, -1, "-99999.77", "false"},
                                    {35, 30, "-99999.999999999999999999971296473906", -1, -1, "-100000.0", "false"},
                                    {35, 30, "4.0268832997E-20", -1, -1, "4.0268832E-20", "false"},
                                    {35, 30, "7.499E-27", -1, -1, "7.499E-27", "false"},
                                    {35, 30, "3.407978626073179E-15", -1, -1, "3.4079786E-15", "false"},
                                    {35, 30, "-99999.999999999999999999999728180424", -1, -1, "-100000.0", "false"},
                                    {35, 30, "4.54277280474947E-16", -1, -1, "4.5427727E-16", "false"},
                                    {35, 30, "3.30955422862741890E-13", -1, -1, "3.3095542E-13", "false"},
                                    {35, 30, "-99999.999999999998752547505305310847", -1, -1, "-100000.0", "false"},
                                    {35, 30, "-99999.999999999999999984880720691276", -1, -1, "-100000.0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_FLOAT>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDecimal128p35s30ToDoubleNormal) {
    CastTestCaseArray test_cases = {
            {35, 30, "1.68431965642E-19", -1, -1, "1.68431965642E-19", "false"},
            {35, 30, "-99999.999999999999999999999992106080", -1, -1, "-100000.0", "false"},
            {35, 30, "-59617.337500887464749536572661264725", -1, -1, "-59617.337500887465", "false"},
            {35, 30, "-99999.999999999999999999986776942381", -1, -1, "-100000.0", "false"},
            {35, 30, "1.8537301525340494E-14", -1, -1, "1.8537301525340493E-14", "false"},
            {35, 30, "0.001074737214579251680307476563", -1, -1, "0.0010747372145792516", "false"},
            {35, 30, "1.686746074050811779832E-9", -1, -1, "1.6867460740508119E-9", "false"},
            {35, 30, "-99999.999998797990867669945947002377", -1, -1, "-99999.999998798", "false"},
            {35, 30, "-99999.999999999831929228106427719609", -1, -1, "-99999.99999999983", "false"},
            {35, 30, "-99999.999999999999999999069705485821", -1, -1, "-100000.0", "false"},
            {35, 30, "-99999.999994304363538503704257862661", -1, -1, "-99999.99999430437", "false"},
            {35, 30, "1.06005936505345E-16", -1, -1, "1.06005936505345E-16", "false"},
            {35, 30, "-5286.677200851683134025428779701331", -1, -1, "-5286.677200851683", "false"},
            {35, 30, "-99999.999999999999996234322160883477", -1, -1, "-100000.0", "false"},
            {35, 30, "4.62325557631E-19", -1, -1, "4.62325557631E-19", "false"},
            {35, 30, "4663.383246313479087298752464279007", -1, -1, "4663.3832463134795", "false"},
            {35, 30, "-99999.999999999960990023465215372716", -1, -1, "-99999.99999999996", "false"},
            {35, 30, "83197.386571659490839771567833966673", -1, -1, "83197.38657165949", "false"},
            {35, 30, "-99993.845444715923986452578369675580", -1, -1, "-99993.84544471593", "false"},
            {35, 30, "2.734300779345E-18", -1, -1, "2.734300779345E-18", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DOUBLE>(test_cases);
}
PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "10970.241", 9, 0, "10970", "false"},
                                    {-1, -1, "-48.719315", 9, 0, "-48", "false"},
                                    {-1, -1, "-1408.9713", 9, 0, "-1408", "false"},
                                    {-1, -1, "78802.836", 9, 0, "78802", "false"},
                                    {-1, -1, "6.9543467", 9, 0, "6", "false"},
                                    {-1, -1, "27.301805", 9, 0, "27", "false"},
                                    {-1, -1, "-0.50205004", 9, 0, "0", "false"},
                                    {-1, -1, "71547.62", 9, 0, "71547", "false"},
                                    {-1, -1, "693.0182", 9, 0, "693", "false"},
                                    {-1, -1, "-3.56673312E8", 9, 0, "-356673312", "false"},
                                    {-1, -1, "-1.2886788E7", 9, 0, "-12886788", "false"},
                                    {-1, -1, "-4.2607472E8", 9, 0, "-426074720", "false"},
                                    {-1, -1, "-85.36526", 9, 0, "-85", "false"},
                                    {-1, -1, "0.0", 9, 0, "0", "false"},
                                    {-1, -1, "-4039438.5", 9, 0, "-4039438", "false"},
                                    {-1, -1, "5074155.5", 9, 0, "5074155", "false"},
                                    {-1, -1, "-5.8706484E7", 9, 0, "-58706484", "false"},
                                    {-1, -1, "6659.37", 9, 0, "6659", "false"},
                                    {-1, -1, "-5.0274856E7", 9, 0, "-50274856", "false"},
                                    {-1, -1, "-2496.0417", 9, 0, "-2496", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1.72538528E8", 9, 2, "", "true"},
                                    {-1, -1, "-1.27143411E9", 9, 2, "", "true"},
                                    {-1, -1, "4.98847488E8", 9, 2, "", "true"},
                                    {-1, -1, "2.7144348E7", 9, 2, "", "true"},
                                    {-1, -1, "-7.6865952E7", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-207370.55", 9, 2, "-207370.54", "false"},
                                    {-1, -1, "-16623.842", 9, 2, "-16623.84", "false"},
                                    {-1, -1, "0.0", 9, 2, "0", "false"},
                                    {-1, -1, "169.02477", 9, 2, "169.02", "false"},
                                    {-1, -1, "137337.39", 9, 2, "137337.39", "false"},
                                    {-1, -1, "-14244.998", 9, 2, "-14244.99", "false"},
                                    {-1, -1, "-83435.17", 9, 2, "-83435.17", "false"},
                                    {-1, -1, "6706053.0", 9, 2, "6706053", "false"},
                                    {-1, -1, "-42016.0", 9, 2, "-42016", "false"},
                                    {-1, -1, "-197455.56", 9, 2, "-197455.56", "false"},
                                    {-1, -1, "-1.6375653", 9, 2, "-1.63", "false"},
                                    {-1, -1, "7729178.0", 9, 2, "7729178", "false"},
                                    {-1, -1, "571353.25", 9, 2, "571353.25", "false"},
                                    {-1, -1, "63806.707", 9, 2, "63806.70", "false"},
                                    {-1, -1, "-9468.871", 9, 2, "-9468.87", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "-1.10864013E9", 9, 9, "", "true"}, {-1, -1, "-94074.516", 9, 9, "", "true"},
            {-1, -1, "-67.663765", 9, 9, "", "true"},    {-1, -1, "33.151947", 9, 9, "", "true"},
            {-1, -1, "9.535683", 9, 9, "", "true"},      {-1, -1, "-50852.766", 9, 9, "", "true"},
            {-1, -1, "8.527241", 9, 9, "", "true"},      {-1, -1, "1222829.9", 9, 9, "", "true"},
            {-1, -1, "-4.0442514", 9, 9, "", "true"},    {-1, -1, "1952.9401", 9, 9, "", "true"},
            {-1, -1, "-1.79323856E8", 9, 9, "", "true"}, {-1, -1, "5.3120346", 9, 9, "", "true"},
            {-1, -1, "1.34350848E8", 9, 9, "", "true"},  {-1, -1, "208780.12", 9, 9, "", "true"},
            {-1, -1, "1719233.0", 9, 9, "", "true"},     {-1, -1, "46.035267", 9, 9, "", "true"},
            {-1, -1, "-75434.46", 9, 9, "", "true"},     {-1, -1, "-609265.44", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "0.60028446", 9, 9, "0.600284457", "false"},
                                    {-1, -1, "-0.23543936", 9, 9, "-0.235439360", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "-224968.77", 7, 4, "", "true"},   {-1, -1, "1.347764E7", 7, 4, "", "true"},
            {-1, -1, "-1.6094612E7", 7, 4, "", "true"}, {-1, -1, "-1.59677709E9", 7, 4, "", "true"},
            {-1, -1, "1.2301896E7", 7, 4, "", "true"},  {-1, -1, "-9.9722072E7", 7, 4, "", "true"},
            {-1, -1, "1.1188692E8", 7, 4, "", "true"},  {-1, -1, "-3.2121138E7", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "91617.46", 7, 4, "91617.4609", "false"},
                                    {-1, -1, "-13741.9795", 7, 4, "-13741.9794", "false"},
                                    {-1, -1, "2805.812", 7, 4, "2805.8120", "false"},
                                    {-1, -1, "6.9628773", 7, 4, "6.9628", "false"},
                                    {-1, -1, "-123.74408", 7, 4, "-123.7440", "false"},
                                    {-1, -1, "-144.42905", 7, 4, "-144.4290", "false"},
                                    {-1, -1, "-77489.55", 7, 4, "-77489.5468", "false"},
                                    {-1, -1, "-4.8811874", 7, 4, "-4.8811", "false"},
                                    {-1, -1, "0.0", 7, 4, "0", "false"},
                                    {-1, -1, "-2.724122", 7, 4, "-2.7241", "false"},
                                    {-1, -1, "534.44507", 7, 4, "534.4450", "false"},
                                    {-1, -1, "1.1364293", 7, 4, "1.1364", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "135898.03", 18, 0, "135898", "false"},
                                    {-1, -1, "3.0969481", 18, 0, "3", "false"},
                                    {-1, -1, "202.0264", 18, 0, "202", "false"},
                                    {-1, -1, "-6278580.0", 18, 0, "-6278580", "false"},
                                    {-1, -1, "1.78645008E8", 18, 0, "178645008", "false"},
                                    {-1, -1, "-3.2413616E7", 18, 0, "-32413616", "false"},
                                    {-1, -1, "2.3615214E7", 18, 0, "23615214", "false"},
                                    {-1, -1, "1.4885012", 18, 0, "1", "false"},
                                    {-1, -1, "104621.41", 18, 0, "104621", "false"},
                                    {-1, -1, "421.3771", 18, 0, "421", "false"},
                                    {-1, -1, "9.4618288E7", 18, 0, "94618288", "false"},
                                    {-1, -1, "-95612.35", 18, 0, "-95612", "false"},
                                    {-1, -1, "7095673.5", 18, 0, "7095673", "false"},
                                    {-1, -1, "153859.84", 18, 0, "153859", "false"},
                                    {-1, -1, "78.9084", 18, 0, "78", "false"},
                                    {-1, -1, "-323.9015", 18, 0, "-323", "false"},
                                    {-1, -1, "-115781.234", 18, 0, "-115781", "false"},
                                    {-1, -1, "38804.137", 18, 0, "38804", "false"},
                                    {-1, -1, "-3.8003744E8", 18, 0, "-380037440", "false"},
                                    {-1, -1, "-4.22586752E8", 18, 0, "-422586752", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "6403.0576", 18, 2, "6403.05", "false"},    {-1, -1, "-416908.6", 18, 2, "-416908.59", "false"},
            {-1, -1, "-374.52243", 18, 2, "-374.52", "false"},   {-1, -1, "-7448.2847", 18, 2, "-7448.28", "false"},
            {-1, -1, "54660.094", 18, 2, "54660.09", "false"},   {-1, -1, "1.6501439", 18, 2, "1.65", "false"},
            {-1, -1, "-934552.3", 18, 2, "-934552.31", "false"}, {-1, -1, "0.020804286", 18, 2, "0.02", "false"},
            {-1, -1, "7.1221914", 18, 2, "7.12", "false"},       {-1, -1, "-21574.484", 18, 2, "-21574.48", "false"},
            {-1, -1, "-98968.22", 18, 2, "-98968.21", "false"},  {-1, -1, "0.46264833", 18, 2, "0.46", "false"},
            {-1, -1, "221174.38", 18, 2, "221174.37", "false"},  {-1, -1, "1.76979072E8", 18, 2, "176979072", "false"},
            {-1, -1, "-5.987686", 18, 2, "-5.98", "false"},      {-1, -1, "2553868.2", 18, 2, "2553868.25", "false"},
            {-1, -1, "25450.646", 18, 2, "25450.64", "false"},   {-1, -1, "-76036.64", 18, 2, "-76036.64", "false"},
            {-1, -1, "-24.997913", 18, 2, "-24.99", "false"},    {-1, -1, "-61.181725", 18, 2, "-61.18", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "0.0", 18, 9, "0", "false"},
                                    {-1, -1, "-682703.0", 18, 9, "-682703", "false"},
                                    {-1, -1, "-440425.72", 18, 9, "-440425.718750000", "false"},
                                    {-1, -1, "-3.1342654", 18, 9, "-3.134265422", "false"},
                                    {-1, -1, "8688586.0", 18, 9, "8688586", "false"},
                                    {-1, -1, "388.7994", 18, 9, "388.799407958", "false"},
                                    {-1, -1, "-18.156658", 18, 9, "-18.156658172", "false"},
                                    {-1, -1, "-2.186429", 18, 9, "-2.186429023", "false"},
                                    {-1, -1, "-4.875391", 18, 9, "-4.875391006", "false"},
                                    {-1, -1, "-166640.9", 18, 9, "-166640.906250000", "false"},
                                    {-1, -1, "-36088.895", 18, 9, "-36088.894531250", "false"},
                                    {-1, -1, "-29912.55", 18, 9, "-29912.550781250", "false"},
                                    {-1, -1, "1.4173866E7", 18, 9, "14173866", "false"},
                                    {-1, -1, "-1289342.5", 18, 9, "-1289342.500000000", "false"},
                                    {-1, -1, "1.949094", 18, 9, "1.949094057", "false"},
                                    {-1, -1, "6736.493", 18, 9, "6736.493164062", "false"},
                                    {-1, -1, "22236.84", 18, 9, "22236.839843750", "false"},
                                    {-1, -1, "383255.38", 18, 9, "383255.375000000", "false"},
                                    {-1, -1, "-3.366468E7", 18, 9, "-33664680", "false"},
                                    {-1, -1, "-4492.8755", 18, 9, "-4492.875488281", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "2604.3047", 18, 18, "", "true"},    {-1, -1, "-75.13791", 18, 18, "", "true"},
            {-1, -1, "-421.6334", 18, 18, "", "true"},    {-1, -1, "-1325920.9", 18, 18, "", "true"},
            {-1, -1, "-1.0055959E9", 18, 18, "", "true"}, {-1, -1, "-7.5412696E7", 18, 18, "", "true"},
            {-1, -1, "-9.702032E8", 18, 18, "", "true"},  {-1, -1, "15.048134", 18, 18, "", "true"},
            {-1, -1, "2658652.8", 18, 18, "", "true"},    {-1, -1, "-371.06107", 18, 18, "", "true"},
            {-1, -1, "313.96405", 18, 18, "", "true"},    {-1, -1, "30.95511", 18, 18, "", "true"},
            {-1, -1, "1.83835712E9", 18, 18, "", "true"}, {-1, -1, "9031.004", 18, 18, "", "true"},
            {-1, -1, "135.19067", 18, 18, "", "true"},    {-1, -1, "5130058.0", 18, 18, "", "true"},
            {-1, -1, "1318.2072", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-1.6450195", 18, 18, "-1.645019531249999872", "false"},
                                    {-1, -1, "-1.9657545", 18, 18, "-1.965754508972167936", "false"},
                                    {-1, -1, "-4.394038", 18, 18, "-4.394038200378418176", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "-4541378.5", 15, 13, "", "true"},
                                    {-1, -1, "3037913.8", 15, 13, "", "true"},
                                    {-1, -1, "-8238643.0", 15, 13, "", "true"},
                                    {-1, -1, "-1.4483907E7", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-0.89487344", 15, 13, "-0.8948734402656", "false"},
                                    {-1, -1, "-131614.89", 15, 13, "-131614.8906249999872", "false"},
                                    {-1, -1, "24832.969", 15, 13, "24832.9687500000000", "false"},
                                    {-1, -1, "-467690.0", 15, 13, "-467690", "false"},
                                    {-1, -1, "2047.9398", 15, 13, "2047.9398193359376", "false"},
                                    {-1, -1, "4.805915", 15, 13, "4.8059148788452", "false"},
                                    {-1, -1, "0.0", 15, 13, "0", "false"},
                                    {-1, -1, "-0.3382293", 15, 13, "-0.3382292985916", "false"},
                                    {-1, -1, "67966.195", 15, 13, "67966.1953124999936", "false"},
                                    {-1, -1, "58.239567", 15, 13, "58.2395668029785", "false"},
                                    {-1, -1, "-372493.8", 15, 13, "-372493.8125000000000", "false"},
                                    {-1, -1, "-84.3005", 15, 13, "-84.3004989624023", "false"},
                                    {-1, -1, "-2425.594", 15, 13, "-2425.5939941406248", "false"},
                                    {-1, -1, "-251.13904", 15, 13, "-251.1390380859375", "false"},
                                    {-1, -1, "-1.1857784", 15, 13, "-1.1857783794403", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-5.6266336E8", 38, 0, "-562663360", "false"},
                                    {-1, -1, "-2.9184694", 38, 0, "-2", "false"},
                                    {-1, -1, "1.28643712E9", 38, 0, "1286437120", "false"},
                                    {-1, -1, "3264568.2", 38, 0, "3264568", "false"},
                                    {-1, -1, "-2.2815122E7", 38, 0, "-22815122", "false"},
                                    {-1, -1, "-5.677846E7", 38, 0, "-56778460", "false"},
                                    {-1, -1, "8.7541968E7", 38, 0, "87541968", "false"},
                                    {-1, -1, "-1454.9442", 38, 0, "-1454", "false"},
                                    {-1, -1, "-133889.45", 38, 0, "-133889", "false"},
                                    {-1, -1, "-18116.822", 38, 0, "-18116", "false"},
                                    {-1, -1, "30.533478", 38, 0, "30", "false"},
                                    {-1, -1, "44883.94", 38, 0, "44883", "false"},
                                    {-1, -1, "2421.5024", 38, 0, "2421", "false"},
                                    {-1, -1, "6110.1123", 38, 0, "6110", "false"},
                                    {-1, -1, "664.78033", 38, 0, "664", "false"},
                                    {-1, -1, "1.12912792E8", 38, 0, "112912792", "false"},
                                    {-1, -1, "-64.84323", 38, 0, "-64", "false"},
                                    {-1, -1, "-5993.9077", 38, 0, "-5993", "false"},
                                    {-1, -1, "4954853.5", 38, 0, "4954853", "false"},
                                    {-1, -1, "-20787.607", 38, 0, "-20787", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-1.05592576E8", 38, 2, "-105592576", "false"},
                                    {-1, -1, "-1.71261712E8", 38, 2, "-171261712", "false"},
                                    {-1, -1, "-7358906.0", 38, 2, "-7358906", "false"},
                                    {-1, -1, "8.8563987E8", 38, 2, "885639872", "false"},
                                    {-1, -1, "-701124.5", 38, 2, "-701124.50", "false"},
                                    {-1, -1, "-1.1713119", 38, 2, "-1.17", "false"},
                                    {-1, -1, "3174.021", 38, 2, "3174.02", "false"},
                                    {-1, -1, "8.089443", 38, 2, "8.08", "false"},
                                    {-1, -1, "-5.1844506", 38, 2, "-5.18", "false"},
                                    {-1, -1, "4.045084", 38, 2, "4.04", "false"},
                                    {-1, -1, "2.5054674E7", 38, 2, "25054674", "false"},
                                    {-1, -1, "-64.2272", 38, 2, "-64.22", "false"},
                                    {-1, -1, "58439.523", 38, 2, "58439.52", "false"},
                                    {-1, -1, "0.0", 38, 2, "0", "false"},
                                    {-1, -1, "-0.67865443", 38, 2, "-0.67", "false"},
                                    {-1, -1, "-10.376032", 38, 2, "-10.37", "false"},
                                    {-1, -1, "1420.9169", 38, 2, "1420.91", "false"},
                                    {-1, -1, "51255.227", 38, 2, "51255.22", "false"},
                                    {-1, -1, "37.552265", 38, 2, "37.55", "false"},
                                    {-1, -1, "67629.98", 38, 2, "67629.97", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-6916199.0", 38, 9, "-6916199", "false"},
                                    {-1, -1, "-516.43787", 38, 9, "-516.437866210", "false"},
                                    {-1, -1, "-2.00452768E8", 38, 9, "-200452768", "false"},
                                    {-1, -1, "-5.8918502E8", 38, 9, "-589185024", "false"},
                                    {-1, -1, "-640929.6", 38, 9, "-640929.625000000", "false"},
                                    {-1, -1, "-4036530.8", 38, 9, "-4036530.750000000", "false"},
                                    {-1, -1, "-166761.38", 38, 9, "-166761.375000000", "false"},
                                    {-1, -1, "7763.8584", 38, 9, "7763.858398437", "false"},
                                    {-1, -1, "-7.6385176E7", 38, 9, "-76385176", "false"},
                                    {-1, -1, "-15235.382", 38, 9, "-15235.381835937", "false"},
                                    {-1, -1, "11498.881", 38, 9, "11498.880859375", "false"},
                                    {-1, -1, "4.5956432E8", 38, 9, "459564320", "false"},
                                    {-1, -1, "2013.2043", 38, 9, "2013.204345703", "false"},
                                    {-1, -1, "-1.2549722E7", 38, 9, "-12549722", "false"},
                                    {-1, -1, "1223721.9", 38, 9, "1223721.875000000", "false"},
                                    {-1, -1, "-284.7367", 38, 9, "-284.736694335", "false"},
                                    {-1, -1, "-4.62911264E8", 38, 9, "-462911264", "false"},
                                    {-1, -1, "-468.25305", 38, 9, "-468.253051757", "false"},
                                    {-1, -1, "-4.28048512E8", 38, 9, "-428048512", "false"},
                                    {-1, -1, "-8479.203", 38, 9, "-8479.203125000", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "1.07381504E9", 38, 13, "1073815040", "false"},
                                    {-1, -1, "0.0", 38, 13, "0", "false"},
                                    {-1, -1, "-4523.6904", 38, 13, "-4523.6904296875000", "false"},
                                    {-1, -1, "-2.1123834", 38, 13, "-2.1123833656311", "false"},
                                    {-1, -1, "241.65732", 38, 13, "241.6573181152344", "false"},
                                    {-1, -1, "26288.914", 38, 13, "26288.9140625000000", "false"},
                                    {-1, -1, "1.75115981E9", 38, 13, "1751159808", "false"},
                                    {-1, -1, "1.22323144E8", 38, 13, "122323144", "false"},
                                    {-1, -1, "4.3469152E7", 38, 13, "43469152", "false"},
                                    {-1, -1, "410356.1", 38, 13, "410356.0937500000300", "false"},
                                    {-1, -1, "0.47269404", 38, 13, "0.4726940393447", "false"},
                                    {-1, -1, "-117216.47", 38, 13, "-117216.4687500000000", "false"},
                                    {-1, -1, "2.16233936E8", 38, 13, "216233935.9999999900000", "false"},
                                    {-1, -1, "10460.652", 38, 13, "10460.6523437500000", "false"},
                                    {-1, -1, "-1445.4716", 38, 13, "-1445.4715576171876", "false"},
                                    {-1, -1, "-638528.8", 38, 13, "-638528.8124999999500", "false"},
                                    {-1, -1, "0.8988988", 38, 13, "0.8988987803459", "false"},
                                    {-1, -1, "0.92744", 38, 13, "0.9274399876594", "false"},
                                    {-1, -1, "2058.3733", 38, 13, "2058.3732910156248", "false"},
                                    {-1, -1, "976572.06", 38, 13, "976572.0625000000000", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-1.38113101E9", 38, 18, "-1381131008", "false"},
                                    {-1, -1, "5131.836", 38, 18, "5131.835937500000000000", "false"},
                                    {-1, -1, "-5.6661396", 38, 18, "-5.666139602661133300", "false"},
                                    {-1, -1, "-73148.87", 38, 18, "-73148.867187500000000000", "false"},
                                    {-1, -1, "1.2963436E8", 38, 18, "129634360", "false"},
                                    {-1, -1, "-679546.4", 38, 18, "-679546.375000000000000000", "false"},
                                    {-1, -1, "364.84256", 38, 18, "364.842559814453100000", "false"},
                                    {-1, -1, "-399757.7", 38, 18, "-399757.687500000000000000", "false"},
                                    {-1, -1, "1.91257446E9", 38, 18, "1912574464", "false"},
                                    {-1, -1, "68948.31", 38, 18, "68948.312500000000000000", "false"},
                                    {-1, -1, "-0.27570796", 38, 18, "-0.275707960128784192", "false"},
                                    {-1, -1, "63963.094", 38, 18, "63963.093750000000000000", "false"},
                                    {-1, -1, "-109.648735", 38, 18, "-109.648735046386710000", "false"},
                                    {-1, -1, "-1.79486707E9", 38, 18, "-1794867072", "false"},
                                    {-1, -1, "6.5786643", 38, 18, "6.578664302825927700", "false"},
                                    {-1, -1, "-384636.6", 38, 18, "-384636.593750000000000000", "false"},
                                    {-1, -1, "99150.12", 38, 18, "99150.117187500000000000", "false"},
                                    {-1, -1, "-1690541.2", 38, 18, "-1690541.250000000000000000", "false"},
                                    {-1, -1, "909572.56", 38, 18, "909572.562500000000000000", "false"},
                                    {-1, -1, "-3242219.2", 38, 18, "-3242219.250000000000000000", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "8.785481E8", 35, 30, "", "true"},
                                    {-1, -1, "-3.71462912E8", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromFloatToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "74.02252", 35, 30, "74.022521972656250000000000000000", "false"},
                                    {-1, -1, "17.681469", 35, 30, "17.681468963623048000000000000000", "false"},
                                    {-1, -1, "1.1429209E7", 35, 30, "11429209.000000010000000000000000000000", "false"},
                                    {-1, -1, "-3669.0103", 35, 30, "-3669.010253906250000000000000000000", "false"},
                                    {-1, -1, "10841.191", 35, 30, "10841.191406250000000000000000000000", "false"},
                                    {-1, -1, "228161.14", 35, 30, "228161.140625000000000000000000000000", "false"},
                                    {-1, -1, "2443088.5", 35, 30, "2443088.500000000000000000000000000000", "false"},
                                    {-1, -1, "22.013708", 35, 30, "22.013708114624023000000000000000", "false"},
                                    {-1, -1, "38.653866", 35, 30, "38.653865814208986000000000000000", "false"},
                                    {-1, -1, "9.7068088E7", 35, 30, "97068088.000000010000000000000000000000", "false"},
                                    {-1, -1, "3225200.0", 35, 30, "3225200", "false"},
                                    {-1, -1, "659.6253", 35, 30, "659.625305175781300000000000000000", "false"},
                                    {-1, -1, "689.80096", 35, 30, "689.800964355468800000000000000000", "false"},
                                    {-1, -1, "7508718.5", 35, 30, "7508718.500000000000000000000000000000", "false"},
                                    {-1, -1, "360013.8", 35, 30, "360013.812500000000000000000000000000", "false"},
                                    {-1, -1, "-174694.33", 35, 30, "-174694.328125000000000000000000000000", "false"},
                                    {-1, -1, "659.4308", 35, 30, "659.430786132812500000000000000000", "false"},
                                    {-1, -1, "-0.3675406", 35, 30, "-0.367540597915649400000000000000", "false"}};
    test_cast_all<TYPE_FLOAT, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1.7688412291200012E10", 9, 0, "", "true"},   {-1, -1, "-2.6259828399605347E11", 9, 0, "", "true"},
            {-1, -1, "-3.5378520548188467E9", 9, 0, "", "true"},   {-1, -1, "-7.370980594784436E12", 9, 0, "", "true"},
            {-1, -1, "2.5242913838341232E10", 9, 0, "", "true"},   {-1, -1, "6.1598361000092375E13", 9, 0, "", "true"},
            {-1, -1, "-2.7326381978133984E12", 9, 0, "", "true"},  {-1, -1, "-8.3224631122380001E18", 9, 0, "", "true"},
            {-1, -1, "-1.01696130696460032E17", 9, 0, "", "true"}, {-1, -1, "6.914519136385502E12", 9, 0, "", "true"},
            {-1, -1, "-2.3359864948321659E18", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "563.2981443005733", 9, 0, "563", "false"},
                                    {-1, -1, "1.144862420609932E7", 9, 0, "11448624", "false"},
                                    {-1, -1, "833.471339150878", 9, 0, "833", "false"},
                                    {-1, -1, "-211161.88836548335", 9, 0, "-211161", "false"},
                                    {-1, -1, "921438.6729703041", 9, 0, "921438", "false"},
                                    {-1, -1, "-1.706442667369641E8", 9, 0, "-170644266", "false"},
                                    {-1, -1, "-129.11248896827806", 9, 0, "-129", "false"},
                                    {-1, -1, "-15.39083013560152", 9, 0, "-15", "false"},
                                    {-1, -1, "1174622.8027493742", 9, 0, "1174622", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1.0433584087149387E13", 9, 2, "", "true"},  {-1, -1, "5.3389021383955366E17", 9, 2, "", "true"},
            {-1, -1, "-1.4465748917606366E16", 9, 2, "", "true"}, {-1, -1, "6.9046316169840806E17", 9, 2, "", "true"},
            {-1, -1, "4.315957911503254E10", 9, 2, "", "true"},   {-1, -1, "2.542164758062504E10", 9, 2, "", "true"},
            {-1, -1, "5.503320672004507E13", 9, 2, "", "true"},   {-1, -1, "9.627553203501182E15", 9, 2, "", "true"},
            {-1, -1, "3.530133047491941E15", 9, 2, "", "true"},   {-1, -1, "8.3069599348992282E17", 9, 2, "", "true"},
            {-1, -1, "5.641564242025942E15", 9, 2, "", "true"},   {-1, -1, "-2.1279364303960327E11", 9, 2, "", "true"},
            {-1, -1, "3.2860442591688184E11", 9, 2, "", "true"},  {-1, -1, "-3.58855242338907E8", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-2064094.0739346247", 9, 2, "-2064094.07", "false"},
                                    {-1, -1, "-36.54267518963301", 9, 2, "-36.54", "false"},
                                    {-1, -1, "-9304324.067640642", 9, 2, "-9304324.06", "false"},
                                    {-1, -1, "3.0057509191649245", 9, 2, "3", "false"},
                                    {-1, -1, "-6.144109516047832", 9, 2, "-6.14", "false"},
                                    {-1, -1, "2910.7699654209337", 9, 2, "2910.76", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "183.2133921769515", 9, 9, "", "true"},      {-1, -1, "-4403157.508914497", 9, 9, "", "true"},
            {-1, -1, "-199.59464932800245", 9, 9, "", "true"},    {-1, -1, "3.0899672861222405E15", 9, 9, "", "true"},
            {-1, -1, "-21466.56404692825", 9, 9, "", "true"},     {-1, -1, "-8.462401668185848E11", 9, 9, "", "true"},
            {-1, -1, "22.091358302767905", 9, 9, "", "true"},     {-1, -1, "-152.62953970382665", 9, 9, "", "true"},
            {-1, -1, "2.537787238605047E13", 9, 9, "", "true"},   {-1, -1, "-4.690207998095089E8", 9, 9, "", "true"},
            {-1, -1, "-5.6853740120157016E13", 9, 9, "", "true"}, {-1, -1, "599.1947251338687", 9, 9, "", "true"},
            {-1, -1, "8.422445512787448", 9, 9, "", "true"},      {-1, -1, "-3.1574718640286705", 9, 9, "", "true"},
            {-1, -1, "-4.9153894076610657E11", 9, 9, "", "true"}, {-1, -1, "-2.7467138266541536E17", 9, 9, "", "true"},
            {-1, -1, "1.2672513921166213E9", 9, 9, "", "true"},   {-1, -1, "72.95180413390432", 9, 9, "", "true"},
            {-1, -1, "359002.7064313366", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "0.0", 9, 9, "0", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "-6.518593954908171E7", 7, 4, "", "true"},   {-1, -1, "-2.60703069288856544E17", 7, 4, "", "true"},
            {-1, -1, "8.59842427340985E12", 7, 4, "", "true"},    {-1, -1, "5.4588398541767654E10", 7, 4, "", "true"},
            {-1, -1, "1.84387207823365427E18", 7, 4, "", "true"}, {-1, -1, "1.5194398000785012E15", 7, 4, "", "true"},
            {-1, -1, "3.1059574902424856E14", 7, 4, "", "true"},  {-1, -1, "5.089399123086132E15", 7, 4, "", "true"},
            {-1, -1, "-7.971957342166541E9", 7, 4, "", "true"},   {-1, -1, "-1.3379438778370752E11", 7, 4, "", "true"},
            {-1, -1, "1254365.8369479307", 7, 4, "", "true"},     {-1, -1, "-4.5122010085428026E17", 7, 4, "", "true"},
            {-1, -1, "1.3898388748425747E12", 7, 4, "", "true"},  {-1, -1, "3.107994489195247E11", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "143776.60554854575", 7, 4, "143776.6055", "false"},
                                    {-1, -1, "2694.351143497504", 7, 4, "2694.3511", "false"},
                                    {-1, -1, "-191.72954195056855", 7, 4, "-191.7295", "false"},
                                    {-1, -1, "-173013.22289658818", 7, 4, "-173013.2228", "false"},
                                    {-1, -1, "-156.31590386474818", 7, 4, "-156.3159", "false"},
                                    {-1, -1, "3436.6964533578057", 7, 4, "3436.6964", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "9.668272009885312E12", 18, 0, "9668272009885", "false"},
                                    {-1, -1, "-112.30660122965983", 18, 0, "-112", "false"},
                                    {-1, -1, "-6514774.775825896", 18, 0, "-6514774", "false"},
                                    {-1, -1, "8.145298166648815E8", 18, 0, "814529816", "false"},
                                    {-1, -1, "0.5548411702429104", 18, 0, "0", "false"},
                                    {-1, -1, "1.0069027149154303E10", 18, 0, "10069027149", "false"},
                                    {-1, -1, "4297710.098577101", 18, 0, "4297710", "false"},
                                    {-1, -1, "5.696948373378998", 18, 0, "5", "false"},
                                    {-1, -1, "-5.888967402672585E9", 18, 0, "-5888967402", "false"},
                                    {-1, -1, "3.030166794277735", 18, 0, "3", "false"},
                                    {-1, -1, "2.9069868519166785E8", 18, 0, "290698685", "false"},
                                    {-1, -1, "3458947.317928398", 18, 0, "3458947", "false"},
                                    {-1, -1, "1.3816691884422272", 18, 0, "1", "false"},
                                    {-1, -1, "-13281.68288779748", 18, 0, "-13281", "false"},
                                    {-1, -1, "-3.8392354705915637E9", 18, 0, "-3839235470", "false"},
                                    {-1, -1, "91.24033191755616", 18, 0, "91", "false"},
                                    {-1, -1, "1.6668499106067678E15", 18, 0, "1666849910606767", "false"},
                                    {-1, -1, "5.376863099911114E8", 18, 0, "537686309", "false"},
                                    {-1, -1, "138.59390824001284", 18, 0, "138", "false"},
                                    {-1, -1, "-1.7790084898846677E8", 18, 0, "-177900848", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "3.466522449648106E13", 18, 2, "34665224496481.06", "false"},
                                    {-1, -1, "5.754147809416807", 18, 2, "5.75", "false"},
                                    {-1, -1, "31.512530645163952", 18, 2, "31.51", "false"},
                                    {-1, -1, "19.796579826541375", 18, 2, "19.79", "false"},
                                    {-1, -1, "4.1997087115963645E15", 18, 2, "4199708711596364.80", "false"},
                                    {-1, -1, "5.938920493623317E13", 18, 2, "59389204936233.17", "false"},
                                    {-1, -1, "-2.393390101164139E8", 18, 2, "-239339010.11", "false"},
                                    {-1, -1, "-361.0299445785172", 18, 2, "-361.02", "false"},
                                    {-1, -1, "79.31529175992577", 18, 2, "79.31", "false"},
                                    {-1, -1, "4.775415077179906E12", 18, 2, "4775415077179.90", "false"},
                                    {-1, -1, "-2256543.8222294822", 18, 2, "-2256543.82", "false"},
                                    {-1, -1, "6.563079548502338E15", 18, 2, "6563079548502338.56", "false"},
                                    {-1, -1, "-1.1592463515597104E16", 18, 2, "-11592463515597104.64", "false"},
                                    {-1, -1, "9.665540935334528E13", 18, 2, "96655409353345.28", "false"},
                                    {-1, -1, "4.958182160185259E15", 18, 2, "4958182160185258.88", "false"},
                                    {-1, -1, "-0.6477467697829751", 18, 2, "-0.64", "false"},
                                    {-1, -1, "-4.5188474726005912E16", 18, 2, "-45188474726005913.60", "false"},
                                    {-1, -1, "-3.079070294077179E8", 18, 2, "-307907029.40", "false"},
                                    {-1, -1, "6.663719925607033E10", 18, 2, "66637199256.07", "false"},
                                    {-1, -1, "-424.59722096926293", 18, 2, "-424.59", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "-2.3026825462368003E12", 18, 9, "", "true"},
                                    {-1, -1, "-5.203787804263919E15", 18, 9, "", "true"},
                                    {-1, -1, "-1.5957228363460672E10", 18, 9, "", "true"},
                                    {-1, -1, "-9.374006078831389E14", 18, 9, "", "true"},
                                    {-1, -1, "2.322864871392423E12", 18, 9, "", "true"},
                                    {-1, -1, "4.2816382659231255E15", 18, 9, "", "true"},
                                    {-1, -1, "1.874816595524804E16", 18, 9, "", "true"},
                                    {-1, -1, "-1.36977879123982064E17", 18, 9, "", "true"},
                                    {-1, -1, "-6.5252054649475041E18", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "1733.7087045048174", 18, 9, "1733.708704504", "false"},
                                    {-1, -1, "0.0", 18, 9, "0", "false"},
                                    {-1, -1, "1807.8675646121148", 18, 9, "1807.867564612", "false"},
                                    {-1, -1, "1.229329234315488E9", 18, 9, "1229329234.315488000", "false"},
                                    {-1, -1, "695677.935797574", 18, 9, "695677.935797574", "false"},
                                    {-1, -1, "-84.99021368087908", 18, 9, "-84.990213680", "false"},
                                    {-1, -1, "3.1462101885655445E8", 18, 9, "314621018.856554432", "false"},
                                    {-1, -1, "19384.57971881629", 18, 9, "19384.579718816", "false"},
                                    {-1, -1, "-7.430524469366291E9", 18, 9, "-7430524469.366291456", "false"},
                                    {-1, -1, "-9.473604044945098E8", 18, 9, "-947360404.494509824", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1.0891024356082132E10", 18, 18, "", "true"},
                                    {-1, -1, "-9.7325450200383952E16", 18, 18, "", "true"},
                                    {-1, -1, "3.232136779180043E11", 18, 18, "", "true"},
                                    {-1, -1, "2657.0386920785168", 18, 18, "", "true"},
                                    {-1, -1, "-8.5022344655690064E16", 18, 18, "", "true"},
                                    {-1, -1, "126.67008377996193", 18, 18, "", "true"},
                                    {-1, -1, "2.6262613909404544E17", 18, 18, "", "true"},
                                    {-1, -1, "-2035923.4903036754", 18, 18, "", "true"},
                                    {-1, -1, "-47.3596211291834", 18, 18, "", "true"},
                                    {-1, -1, "4.2423460439014598E17", 18, 18, "", "true"},
                                    {-1, -1, "7.019723562944499E9", 18, 18, "", "true"},
                                    {-1, -1, "8.6817278146201139E18", 18, 18, "", "true"},
                                    {-1, -1, "4376979.692093069", 18, 18, "", "true"},
                                    {-1, -1, "-4.2187010434507016E16", 18, 18, "", "true"},
                                    {-1, -1, "-9.899480490080048E9", 18, 18, "", "true"},
                                    {-1, -1, "97742.30105318013", 18, 18, "", "true"},
                                    {-1, -1, "3.194858692938121E9", 18, 18, "", "true"},
                                    {-1, -1, "-5.81798433570621E8", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "7.2171801328074", 18, 18, "7.217180132807399424", "false"},
                                    {-1, -1, "2.054735646406635", 18, 18, "2.054735646406634752", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1.2651580572925748E8", 15, 13, "", "true"},
                                    {-1, -1, "1.36492086611354854E18", 15, 13, "", "true"},
                                    {-1, -1, "3.3657654971491218E9", 15, 13, "", "true"},
                                    {-1, -1, "4.6409215988660922E17", 15, 13, "", "true"},
                                    {-1, -1, "-1.4785907018995054E10", 15, 13, "", "true"},
                                    {-1, -1, "-1.20554034734100096E18", 15, 13, "", "true"},
                                    {-1, -1, "5.4369946509331384E18", 15, 13, "", "true"},
                                    {-1, -1, "-3.0496085863424346E12", 15, 13, "", "true"},
                                    {-1, -1, "-5615912.38838717", 15, 13, "", "true"},
                                    {-1, -1, "1.730496795699954E8", 15, 13, "", "true"},
                                    {-1, -1, "-5.011298122000055E17", 15, 13, "", "true"},
                                    {-1, -1, "-1.557677366788384E7", 15, 13, "", "true"},
                                    {-1, -1, "6.139287874834862E11", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-11.634502483694337", 15, 13, "-11.6345024836943", "false"},
                                    {-1, -1, "1012.1739979915868", 15, 13, "1012.1739979915868", "false"},
                                    {-1, -1, "-97.32205029180439", 15, 13, "-97.3220502918043", "false"},
                                    {-1, -1, "201.32818746648948", 15, 13, "201.3281874664894", "false"},
                                    {-1, -1, "-2553.250982941662", 15, 13, "-2553.2509829416620", "false"},
                                    {-1, -1, "-0.2020401057276776", 15, 13, "-0.2020401057276", "false"},
                                    {-1, -1, "-550.1934096087264", 15, 13, "-550.1934096087264", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "9.3708260864411552E16", 38, 0, "93708260864411552", "false"},
                                    {-1, -1, "3.9303897905242753E9", 38, 0, "3930389790", "false"},
                                    {-1, -1, "1.4678173562173137E8", 38, 0, "146781735", "false"},
                                    {-1, -1, "287627.5680895054", 38, 0, "287627", "false"},
                                    {-1, -1, "-44.67909772390807", 38, 0, "-44", "false"},
                                    {-1, -1, "75998.87934144856", 38, 0, "75998", "false"},
                                    {-1, -1, "9.295669758428202E8", 38, 0, "929566975", "false"},
                                    {-1, -1, "-3.571289561717291E8", 38, 0, "-357128956", "false"},
                                    {-1, -1, "2.809894499033483E9", 38, 0, "2809894499", "false"},
                                    {-1, -1, "-1.8519022910325938E13", 38, 0, "-18519022910325", "false"},
                                    {-1, -1, "-8.85722388230288", 38, 0, "-8", "false"},
                                    {-1, -1, "2832283.2816495653", 38, 0, "2832283", "false"},
                                    {-1, -1, "3810063.4365247986", 38, 0, "3810063", "false"},
                                    {-1, -1, "3.7919800333424666E18", 38, 0, "3791980033342466600", "false"},
                                    {-1, -1, "-5.037731347640974", 38, 0, "-5", "false"},
                                    {-1, -1, "1444960.3334395373", 38, 0, "1444960", "false"},
                                    {-1, -1, "-22975.054844932834", 38, 0, "-22975", "false"},
                                    {-1, -1, "3.1180678883602054E17", 38, 0, "311806788836020540", "false"},
                                    {-1, -1, "-3.845392778187601E7", 38, 0, "-38453927", "false"},
                                    {-1, -1, "-5.4569613226133592E16", 38, 0, "-54569613226133592", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-1.4396586508657192E12", 38, 2, "-1439658650865.71", "false"},
                                    {-1, -1, "14.408321020769083", 38, 2, "14.40", "false"},
                                    {-1, -1, "-175.6902322423361", 38, 2, "-175.69", "false"},
                                    {-1, -1, "1.2629483998227498E11", 38, 2, "126294839982.27", "false"},
                                    {-1, -1, "6.174929753062904E8", 38, 2, "617492975.30", "false"},
                                    {-1, -1, "1.8048366980264392E16", 38, 2, "18048366980264391.70", "false"},
                                    {-1, -1, "439967.19896664895", 38, 2, "439967.19", "false"},
                                    {-1, -1, "-537.1965115730646", 38, 2, "-537.19", "false"},
                                    {-1, -1, "-1.0937200631069994E9", 38, 2, "-1093720063.10", "false"},
                                    {-1, -1, "-3210.895044570753", 38, 2, "-3210.89", "false"},
                                    {-1, -1, "8.222587747749415E15", 38, 2, "8222587747749414.40", "false"},
                                    {-1, -1, "13483.24944694897", 38, 2, "13483.24", "false"},
                                    {-1, -1, "1.275143458597354E12", 38, 2, "1275143458597.35", "false"},
                                    {-1, -1, "1.4950669149844151E7", 38, 2, "14950669.14", "false"},
                                    {-1, -1, "-6.1441479029771624E16", 38, 2, "-61441479029771622", "false"},
                                    {-1, -1, "1.4464165621857235E8", 38, 2, "144641656.21", "false"},
                                    {-1, -1, "-29198.03792412416", 38, 2, "-29198.03", "false"},
                                    {-1, -1, "4.091627234785617", 38, 2, "4.09", "false"},
                                    {-1, -1, "-8.18330133340961", 38, 2, "-8.18", "false"},
                                    {-1, -1, "-8.583957215772053E12", 38, 2, "-8583957215772.05", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "-4.401464287822371E13", 38, 9, "-44014642878223.710000000", "false"},
                                    {-1, -1, "-393207.84132852295", 38, 9, "-393207.841328522", "false"},
                                    {-1, -1, "-5.7146599737432305E13", 38, 9, "-57146599737432.300000000", "false"},
                                    {-1, -1, "1.9059456470395584E16", 38, 9, "19059456470395584", "false"},
                                    {-1, -1, "1.4564238065840734E7", 38, 9, "14564238.065840734", "false"},
                                    {-1, -1, "-47209.50005861911", 38, 9, "-47209.500058619", "false"},
                                    {-1, -1, "3.8001294634636498E18", 38, 9, "3800129463463650000", "false"},
                                    {-1, -1, "7.300313363139683E15", 38, 9, "7300313363139683", "false"},
                                    {-1, -1, "-112315.54857683067", 38, 9, "-112315.548576830", "false"},
                                    {-1, -1, "-4.311535621524858E7", 38, 9, "-43115356.215248576", "false"},
                                    {-1, -1, "1.1332151076758588E13", 38, 9, "11332151076758.588000000", "false"},
                                    {-1, -1, "-1.7046848893721828E13", 38, 9, "-17046848893721.829000000", "false"},
                                    {-1, -1, "2.3568933588399768E16", 38, 9, "23568933588399767", "false"},
                                    {-1, -1, "18535.419774587353", 38, 9, "18535.419774587", "false"},
                                    {-1, -1, "-14.88026953288756", 38, 9, "-14.880269532", "false"},
                                    {-1, -1, "2.25646281401086E13", 38, 9, "22564628140108.603000000", "false"},
                                    {-1, -1, "-8.671656983685497E12", 38, 9, "-8671656983685.497000000", "false"},
                                    {-1, -1, "16919.877070963303", 38, 9, "16919.877070963", "false"},
                                    {-1, -1, "5352.099359227578", 38, 9, "5352.099359227", "false"},
                                    {-1, -1, "1.6461715256711604E13", 38, 9, "16461715256711.603000000", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "3.094149201927847E14", 38, 13, "309414920192784.7000000000000", "false"},
            {-1, -1, "1.38505382951524326E18", 38, 13, "1385053829515243200", "false"},
            {-1, -1, "5.243692070989579E10", 38, 13, "52436920709.8957900000000", "false"},
            {-1, -1, "-4.5483424178228512E16", 38, 13, "-45483424178228514", "false"},
            {-1, -1, "484.41464031549197", 38, 13, "484.4146403154920", "false"},
            {-1, -1, "-4.765533044122323E8", 38, 13, "-476553304.4122323000000", "false"},
            {-1, -1, "2.904070145155983E7", 38, 13, "29040701.4515598300000", "false"},
            {-1, -1, "-2.28572091116494746E18", 38, 13, "-2285720911164947300", "false"},
            {-1, -1, "-356.32019428803517", 38, 13, "-356.3201942880351", "false"},
            {-1, -1, "5.5949198955043297E18", 38, 13, "5594919895504330000", "false"},
            {-1, -1, "-1.8801205256315686E12", 38, 13, "-1880120525631.5686000000000", "false"},
            {-1, -1, "-578977.2192134253", 38, 13, "-578977.2192134252500", "false"},
            {-1, -1, "-1.7131402951213288E14", 38, 13, "-171314029512132.8800000000000", "false"},
            {-1, -1, "-4040884.287981042", 38, 13, "-4040884.2879810420000", "false"},
            {-1, -1, "-299440.4140397302", 38, 13, "-299440.4140397302300", "false"},
            {-1, -1, "-3.150453907130028E14", 38, 13, "-315045390713002.8000000000000", "false"},
            {-1, -1, "3.317315186866436E16", 38, 13, "33173151868664360", "false"},
            {-1, -1, "5.14028187354455E9", 38, 13, "5140281873.5445500000000", "false"},
            {-1, -1, "4.519062626375645E15", 38, 13, "4519062626375645", "false"},
            {-1, -1, "-1.0339420650426815E10", 38, 13, "-10339420650.4268150000000", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "-3.739256070816927E10", 38, 18, "-37392560708.169274000000000000", "false"},
            {-1, -1, "-766816.4076076492", 38, 18, "-766816.407607649300000000", "false"},
            {-1, -1, "-86.6459340535755", 38, 18, "-86.645934053575500000", "false"},
            {-1, -1, "9.573061463857416E13", 38, 18, "95730614638574.150000000000000000", "false"},
            {-1, -1, "7.0719417599516559E18", 38, 18, "7071941759951656000", "false"},
            {-1, -1, "0.7176859537232495", 38, 18, "0.717685953723249540", "false"},
            {-1, -1, "-3.762431727097642E8", 38, 18, "-376243172.709764200000000000", "false"},
            {-1, -1, "2.695056524942867E9", 38, 18, "2695056524.942867000000000000", "false"},
            {-1, -1, "-2.3245487644581519E18", 38, 18, "-2324548764458151800", "false"},
            {-1, -1, "-2.940642506811008E15", 38, 18, "-2940642506811008", "false"},
            {-1, -1, "-239515.82696390958", 38, 18, "-239515.826963909580000000", "false"},
            {-1, -1, "-1.5070082386631206E14", 38, 18, "-150700823866312.070000000000000000", "false"},
            {-1, -1, "-375830.3212168322", 38, 18, "-375830.321216832240000000", "false"},
            {-1, -1, "-5143452.842362908", 38, 18, "-5143452.842362908000000000", "false"},
            {-1, -1, "3.4480557928744583E9", 38, 18, "3448055792.874458000000000000", "false"},
            {-1, -1, "274.42258748787975", 38, 18, "274.422587487879760000", "false"},
            {-1, -1, "1.116878582842655E10", 38, 18, "11168785828.426550000000000000", "false"},
            {-1, -1, "-6856664.172102638", 38, 18, "-6856664.172102638000000000", "false"},
            {-1, -1, "-8135484.059824696", 38, 18, "-8135484.059824695000000000", "false"},
            {-1, -1, "-1.8748568957002678E14", 38, 18, "-187485689570026.770000000000000000", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1.2811652333302628E16", 35, 30, "", "true"},
                                    {-1, -1, "-7.499599243032418E11", 35, 30, "", "true"},
                                    {-1, -1, "-2.4016835489858885E15", 35, 30, "", "true"},
                                    {-1, -1, "5.156401520101012E11", 35, 30, "", "true"},
                                    {-1, -1, "6.7274320600724058E17", 35, 30, "", "true"},
                                    {-1, -1, "3.9660496553139125E13", 35, 30, "", "true"},
                                    {-1, -1, "-2.15919260744431E16", 35, 30, "", "true"},
                                    {-1, -1, "-2.795048437707844E10", 35, 30, "", "true"},
                                    {-1, -1, "-3.0909040100121914E10", 35, 30, "", "true"},
                                    {-1, -1, "-1.84013539309512416E17", 35, 30, "", "true"},
                                    {-1, -1, "-8.369435498034866E12", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprFloatTest, testCastFromDoubleToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "-5906.042759601254", 35, 30, "-5906.042759601254000000000000000000", "false"},
            {-1, -1, "-9.150943025230598E7", 35, 30, "-91509430.252306000000000000000000000000", "false"},
            {-1, -1, "-1217.1972618717286", 35, 30, "-1217.197261871728600000000000000000", "false"},
            {-1, -1, "-635.9380055546139", 35, 30, "-635.938005554614000000000000000000", "false"},
            {-1, -1, "57.85686418676329", 35, 30, "57.856864186763290000000000000000", "false"},
            {-1, -1, "-1.1891199696317304E7", 35, 30, "-11891199.696317305000000000000000000000", "false"},
            {-1, -1, "0.28365040966259847", 35, 30, "0.283650409662598470000000000000", "false"}};
    test_cast_all<TYPE_DOUBLE, TYPE_DECIMAL128>(test_cases);
}
} // namespace starrocks::vectorized
